Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A gross is a quantity equal to 12 dozen, or 144. Write a program named gross.py that takes integer input from the user using
A gross is a quantity equal to 12 dozen, or 144. Write a program named gross.py that takes integer input from the user using the input function then prints out a number representing that many gross. For example, if the user enters 2, then the output should be 288. tample, if the The following shows an example of what the shell interaction should look like when your program is run twice in Thonny. In both cases, the first number is entered by the user, and the second number is printed by the program. >>> %Run gross.py 2 288 >>> %Run gross.py 100 14400 Be careful! input() will always return a string value. If we need an integer, we can use the int() function to perform the conversion. X = input () # wrong! x = int (input ()) # correct!
Step by Step Solution
★★★★★
3.41 Rating (154 Votes )
There are 3 Steps involved in it
Step: 1
mainpy 1 Read an integer input from the user use...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