Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Taking user input
#1
Hi i am very new to python, and coding in general. I am a sheet metal apprentice, and am trying to do something to figure out the stretchout of a transition(i know you probably dont know what that means). Basically i want to get all the info from the user about the transition. I understand how to do input() to get the numbers that i need, but i need more than numbers. i need to take in alot of info. So one of the things i need to know is what side of the transition offsets(left or right side of transition). this is just one of the things i need, but basically i need to bring in the info, but i cant find out how to do this since it could either be left or right without having to print it using an if statement. i need to get all the info before the program does the math. so i cannot ask the question, and the use an if statement for left or right. I dont know if what i am trying to do is possible, but i want to try it for fun.




this is an example of what i am doing, and i can get about half the info i need because the numbers are easy to acquire. However i dont understand how to ask all the question i need because if i use an if statement then i have to print after i was the question.

###################User input needed###############################

height = float(input("What is the height of the transition? "))

bot_length = float(input("What is the length of transition\(bot of page\)? "))
bot_width = float(input("What is the width of transition\(bot of page\)? "))

top_length = float(input("What is the length of transition\(top of page\)? "))
top_width = float(input("What is the width of transition\(top of page\)? "))


########################Problem section##########################################

offset_left_or_right = input("Which side of the transition is offset? Left or Right? ")

if offset_left_or_right=="left":
bot_left_up_to_left_or_right = input("Is bottom left going up to the left or right? ")
if bot_left_up_to_left_or_right=="left"

else:



#################################what i need###################################

offset_left_or_right = input("Which side of the transition is offset? Left or Right? ")

if offset_left_or_right=="left":
bot_left_up_to_left_or_right = input("Is bottom left going up to the left or right? ")
if bot_left_up_to_left_or_right=="left"
""""SAVE(left = bot_left_up_to_left)""""

"""""bot_left_up_to_left"""""

that way i can use the answer and save it as a new variable that i can use in a math equation

perhaps it would be easier to do a gui to where all the info would be input, but i wouldnt know how to do a gui at all lol
Reply


Messages In This Thread
Taking user input - by mtndewwarrior - Sep-19-2018, 03:03 AM
RE: Taking user input - by ichabod801 - Sep-19-2018, 03:20 AM
RE: Taking user input - by mtndewwarrior - Sep-19-2018, 03:42 AM
RE: Taking user input - by gruntfutuk - Sep-19-2018, 08:14 AM
RE: Taking user input - by mtndewwarrior - Sep-20-2018, 12:35 AM
RE: Taking user input - by ichabod801 - Sep-19-2018, 02:20 PM
RE: Taking user input - by ichabod801 - Sep-20-2018, 01:40 AM
RE: Taking user input - by mtndewwarrior - Sep-20-2018, 03:03 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to revert back to a previous line from user input Sharkenn64u 2 1,289 Dec-28-2024, 08:02 AM
Last Post: Pedroski55
  User input with while loops chizzy101010 2 7,248 Aug-25-2024, 06:00 PM
Last Post: chizzy101010
  WHILE LOOP NOT RETURNING USER INPUT AFTER ZerroDivisionError! HELP! ayodele_martins1 7 2,768 Oct-01-2023, 07:36 PM
Last Post: ayodele_martins1
  restrict user input to numerical values MCL169 2 2,041 Apr-08-2023, 05:40 PM
Last Post: MCL169
  user input values into list of lists tauros73 3 2,121 Dec-29-2022, 05:54 PM
Last Post: deanhystad
Information How to take url in telegram bot user input and put it as an argument in a function? askfriends 0 2,530 Dec-25-2022, 03:00 PM
Last Post: askfriends
Question Take user input and split files using 7z in python askfriends 2 2,501 Dec-11-2022, 07:39 PM
Last Post: snippsat
Sad how to validate user input from database johnconar 3 4,393 Sep-11-2022, 12:36 PM
Last Post: ndc85430
  How to split the input taken from user into a single character? mHosseinDS86 3 2,390 Aug-17-2022, 12:43 PM
Last Post: Pedroski55
  Use pexpect to send user input alisha17 0 3,371 May-10-2022, 02:44 AM
Last Post: alisha17

Forum Jump:

User Panel Messages

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