Question: 2.1: Write a Python program does all the following steps. Make sure you label all your print output to explain what you are printing. This
2.1: Write a Python program does all the following steps. Make sure you label all your print output to explain what you are printing. This is required for all problems in this course. a. Prompts the user to enter a whole number from 1 to 7. No validation required for this problem. b. In one line of code/calculation, performs the following operations on the user supplied number in this exact order: o Multiply by 2 o Add 10 o Divide by 2 o Subtract the user supplied number c. Print the output of this calculation in part b as an integer (no decimal places). d. Now take the same user supplied number from part a and convert it to a threedigit number with incrementing digits. Assign this number to a variable as an integer. o For example, if the user entered '3', the threedigit version is 345. e. Add the three digits together and print the results. o For example, if the user entered 3, you would calculate 3+4+5 = 12. f. Divide the threedigit version by the resulting sum of its digits and print the results as a float. o For example, if the user entered 3, you would calculate 345 / 12. g. Reprint the output of part f as a truncated integer (no decimal places)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
