The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Basic output with variables (Python 3)
main.py (I PUT THIS AT THE BEGINNING AND THE END SO YOU KNOW WHAT I HAVE AND WHAT I NEED) Lost please help
1Â userNum = int(input('Enter integer: n'))
2 print (You entered: ', userNum)Â I think this is line two, but not 100% sure and not sure where to go...
This first line is all I have to this. I am suppose to print some lines of code with the above information which are numbered (1), (2), & (3).
A variable like userNum can store a value like an integer. Extend the given program to print userNum values as indicated. (Submit for 2 points).
(1) Output the user's input.
Enter integer: 4 You entered: 4
(2) Extend to output the input squared and cubed. Hint: Compute squared as userNum * userNum. (Submit for 2 points, so 4 points total).
Enter integer: 4 You entered: 4 4 squared is 16 And 4 cubed is 64 !!
(3) Extend to get a second user input into userNum2. Output sum and product. (Submit for 1 point, so 5 points total).
Enter integer: 4 You entered: 4 4 squared is 16 And 4 cubed is 64 !! Enter another integer: 5 4 + 5 is 9 4 * 5 is 20
main.py
1 userNum = int(input('Enter integer: n'))
2 print (You entered: ', userNum)Â I think this is line two, but not 100% sure and not sure where to go...
This first line is all I have to this. I am suppose to print some lines of code with the above information which are numbered (1), (2), & (3).
Â
Â
Â
Out-----------put----------- an-----------swe-----------r-----------