Python Forum
Prompting user for number, reading number, squaring it and returning result
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Prompting user for number, reading number, squaring it and returning result
#3
Hi gontajones. Thank you for your reply.
Listen, I am new to Python. I have taken a couple of online courses that lasted a few hours each. Now I need to code.
Having said that, this is what I have done:

input("Enter a number")
user_answer = input("Enter a number")
user_answer_squared = user_answer**2
print(user_answer_squared)
Reply


Messages In This Thread
RE: Prompting user for number, reading number, squaring it and returning result - by JHPythonLearner - Sep-12-2018, 11:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Music Python Script Repeating Number When Saving Facebook Photos ThuanyPK 2 137 May-13-2024, 10:59 PM
Last Post: ebn852_pan
  intering int number akbarza 1 273 Apr-28-2024, 08:55 AM
Last Post: Gribouillis
Brick Number stored as text with openpyxl CAD79 2 565 Apr-17-2024, 10:17 AM
Last Post: CAD79
  [SOLVED] Pad strings to always get three-digit number? Winfried 2 419 Jan-27-2024, 05:23 PM
Last Post: Winfried
  Prime number detector Mark17 5 896 Nov-27-2023, 12:53 PM
Last Post: deanhystad
  Create X Number of Variables and Assign Data RockBlok 8 1,052 Nov-14-2023, 08:46 AM
Last Post: perfringo
  find the sum of a series of values that equal a number ancorte 1 539 Oct-30-2023, 05:41 AM
Last Post: Gribouillis
  regex findall() returning weird result Radical 1 709 Oct-15-2023, 08:47 PM
Last Post: snippsat
  WHILE LOOP NOT RETURNING USER INPUT AFTER ZerroDivisionError! HELP! ayodele_martins1 7 1,137 Oct-01-2023, 07:36 PM
Last Post: ayodele_martins1
  capturing multiline output for number of parameters jss 3 864 Sep-01-2023, 05:42 PM
Last Post: jss

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020