1. Create a variable num and assign it an integer value. a) Implement some code that prints if num is divisible by 5 and/or 3. 1. num is divisible by 3 2. num is divisible by 5 Output Example 15 is divisible by 5. 15 is divisible by 3.
1. Create a variable num and assign it an integer value. a) Implement some code that prints if num is divisible by 5 and/or 3. 1. num is divisible by 3 2. num is divisible by 5 Output Example 15 is divisible by 5. 15 is divisible by 3.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Concept explainers
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Question
Please answer in python

Transcribed Image Text:**Week 3 - IT 1613 Assignments**
1. **Task 1:**
- Create a variable `num` and assign it an integer value.
- Implement code that prints if `num` is divisible by 5 and/or 3.
1. `num` is divisible by 3
2. `num` is divisible by 5
**Output Example:**
```
15 is divisible by 5.
15 is divisible by 3.
```
2. **Task 2:**
- Create a variable `num` and assign it an integer value.
- Implement code that prints **only one** of the following statements based on the value of `num`:
1. `num` is divisible by 2
2. `num` is divisible by 4
3. `num` is not divisible by 2 or 4
**Output Example:**
```
12 is divisible by 4.
```
3. **Task 3:**
- Create a variable `num` and assign it an integer value.
- Implement code that prints **only one** of the following statements based on the value of `num`:
1. `num` is a positive even integer greater than 50
2. `num` is a negative odd integer
**Output Example:**
```
52 is a positive even integer greater than 50.
```
![Certainly! Here's a transcription of the text and a description of the exercises as they would appear on an educational website:
---
**Programming Exercises**
4. **Final Grade Calculation**
- Create a variable `final_grade` and assign it a value between 50 and 100.
- **Task:**
1. Print the associated letter grade based on these ranges:
- Between 96 and 100, the letter grade is A.
- Between 64 and 95, the letter grade is Passing.
- Below 64, the letter grade is Not Passing.
2. Test the program with these values for `final_grade`: 96, 95, 75, 64, 63.
**Output Example:**
```
75 is a grade of Passing.
```
5. **Average of Passing Grades**
- Create a list `grades`: 95, 63, 80, 53, 90, 56.
- **Task:**
1. Compute and print the average of all passing grades (64 or better).
**Output Example:**
```
Average of the passing grades is 88.
```
6. **List Comprehension for Multiples**
- Create a list comprehension `numbers` which contains 1 to 30 inclusive.
- **Tasks:**
1. Horizontally print `numbers` that are multiples of 3 or 5.
2. Horizontally print `numbers` that are multiples of 3 but not of 5.
3. Horizontally print `numbers` that are not multiples of 3 or 5.
**Output Example:**
```
3 5 6 9 10 12 15 18 20 21 24 25 27 30 [Multiples of 3 or 5]
3 6 9 12 18 21 24 27 [Multiples of 3 but not 5]
1 2 4 7 8 11 13 14 16 17 19 22 23 26 28 29 [Not multiples of 3 or 5]
```
---
These exercises aim to practice basic programming concepts like conditionals, loops, and list comprehensions using practical examples.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fefd607aa-6776-4e28-838c-67fa22c2e02e%2F9f4873e1-911a-4161-b28a-2d71b86b8574%2F0fmlbhs_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Certainly! Here's a transcription of the text and a description of the exercises as they would appear on an educational website:
---
**Programming Exercises**
4. **Final Grade Calculation**
- Create a variable `final_grade` and assign it a value between 50 and 100.
- **Task:**
1. Print the associated letter grade based on these ranges:
- Between 96 and 100, the letter grade is A.
- Between 64 and 95, the letter grade is Passing.
- Below 64, the letter grade is Not Passing.
2. Test the program with these values for `final_grade`: 96, 95, 75, 64, 63.
**Output Example:**
```
75 is a grade of Passing.
```
5. **Average of Passing Grades**
- Create a list `grades`: 95, 63, 80, 53, 90, 56.
- **Task:**
1. Compute and print the average of all passing grades (64 or better).
**Output Example:**
```
Average of the passing grades is 88.
```
6. **List Comprehension for Multiples**
- Create a list comprehension `numbers` which contains 1 to 30 inclusive.
- **Tasks:**
1. Horizontally print `numbers` that are multiples of 3 or 5.
2. Horizontally print `numbers` that are multiples of 3 but not of 5.
3. Horizontally print `numbers` that are not multiples of 3 or 5.
**Output Example:**
```
3 5 6 9 10 12 15 18 20 21 24 25 27 30 [Multiples of 3 or 5]
3 6 9 12 18 21 24 27 [Multiples of 3 but not 5]
1 2 4 7 8 11 13 14 16 17 19 22 23 26 28 29 [Not multiples of 3 or 5]
```
---
These exercises aim to practice basic programming concepts like conditionals, loops, and list comprehensions using practical examples.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education