Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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 three-digit number with incrementing digits. Assign this number to a variable as an integer. o For example, if the user entered '3', the three-digit 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 three-digit 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. Reprint the output of part 'f' as a truncated integer (no decimal places). g.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
a Prompt the user to enter a whole number from 1 ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started