Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 0 1 ( 1 0 points ) Task 0 2 ( 1 0 points ) Write the following Python program: Your program should ask

Task 01(10 points) Task 02(10 points)
Write the following Python program:
Your program should ask the user to input two integer numbers: start (S) and end (E).
The range of numbers will be from S to E(inclusive).
The program should first print all the odd numbers from S to E, each on a new line.
Next, the program should print all the even numbers from S to E, each on a new line.
If a user enters something that's not an integer number for S or E, your program should
handle this exception and print a warning message: "Invalid input, please enter integer
numbers only".
Here is a screenshot of the expected behavior, testing all scenarios described above. Replicate
this functionality in your script, including the formatting and outputs of all messages. The
program must work for any starting or ending integer values that the user enters.
eric@iftlinux: / lab_g$ ./lab_g_task_02_sdevil.py
Enter a start integer: 10
Enter an end integer: 33
Odd numbers from 10 to 33 :
Write a Python program that takes two integers as input from the user and performs
the following operations:
a. Add the two integers together and store the result in a variable named sum.
b. Subtract the second integer from the first integer and store the result in a variable
named difference.
c. Multiply the two integers together and store the result in a variable named
product.
d. Divide the first integer by the second integer and store the result in a variable
named quotient. The output should be a floating point number.
e. Calculate the remainder when the first integer is divided by the second integer
and store the result in a variable named remainder.
f. Print the values of sum, difference, product, quotient, and the remainder to the
shell/console. Provide a label before each value to indicate what it represents
(i.e. Sum:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

How would you draw a cluster sample for the CityBus project?

Answered: 1 week ago

Question

Describe effectiveness of reading at night?

Answered: 1 week ago

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago

Question

3. How does nonverbal communication express cultural values?

Answered: 1 week ago

Question

2. What types of nonverbal behavior have scholars identifi ed?

Answered: 1 week ago