Sep-19-2018, 03:03 AM
(This post was last modified: Sep-19-2018, 03:20 AM by mtndewwarrior.)
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
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