Question: Solve in python 12. Write a program which computes the absolute value of a user input number. If the user inputs -n the program should
Solve in python
12. Write a program which computes the absolute value of a user input number. If the user inputs -n the program should output n, if the user inputs n the program should output n. The program should not tolerate any bad inputs, such as non-numerical strings. 13. Roulette: write a program which prints the following: 'green' if the user inputs zero * "blue' if the user inputs a positive number . 'red' if the user inputs an odd number below 10 . 'pink' if the user inputs an odd number above 80 'yellow' if the usere inputs an odd number between 10 and 80 14. Rewrite the following code so it only makes one comparison and does not use the "or" operator. choice-input(Do you want to continue: ') if choice y' or print ('continue') choice-'Y
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
