Question: 1- Make a program that uses selections and sqrt Using the IDLE write an improved version of the program that uses sqrt allowing only positive

1- Make a program that uses selections and sqrt

Using the IDLE write an improved version of the program that uses sqrt allowing only positive numbers using an if-else statement.

Add the program below:

Provide the screenshot of the run-output.

2- Writing a program that uses selections and random

Using the IDLE, write a program that generates a random number from -10 to 10 and says if it is positive, negative or zero, and if it is even or odd (3 is odd, 2 is even, 1 is odd, 0 is considered even).

Add the program below:

Provide the screenshot of the run-output.

3- Writing a program with if-else-elif statements

Using the IDLE write a program that asks for a name, and if the name starts with Dr, it replies Hello Dr!, if it begins with Eng, it replies Hello Eng! and if none of the previous is met, it replies Hello Mr!.

Use the slice operator ([a:b]) to get a sub-string from the name and the method .lower() to make a lower case of it to compare for all cases at once. For example, it must say Hello Dr! for names that begin with:

DR, dr, Dr.

Add the program below:

Provide the screenshoot of the run-output.

4- Writing a program that makes a conditioned swap

Using the IDLE, write a program that asks 2 numbers and provide them sorted from the bigger to the smaller.

Add the program below:

Provide the screenshot of the run-output.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!