Mar-30-2017, 02:36 AM
So I've dabbled with Python enough to try a few projects. The first one I'm writing is to convert Fahrenheit to Celcius or Celcius to Fahrenheit.
My plan is:
1. Ask for user input to select F or C to indicate what type this is.
2. Then ask for user input for the temperature that needs to be converted.
3. Perform the correct formula calculation based upon them selecting F or C, if C is selected I'll convert to F or vice versa.
below is step 1 but I'm having issues figuring out how to get a second input from the user for the actual temp to be converted. I'm finding tons of options to print an output from this input but no options to take this input and then request a second input. I'm thinking I need to use functions to perform this but again not sure.
Thanks for any advice.
input_list = ["F", "C"]
P1 = input("Select F or C from: " + ' '.join(input_list) + "\n")
print (P1)
My plan is:
1. Ask for user input to select F or C to indicate what type this is.
2. Then ask for user input for the temperature that needs to be converted.
3. Perform the correct formula calculation based upon them selecting F or C, if C is selected I'll convert to F or vice versa.
below is step 1 but I'm having issues figuring out how to get a second input from the user for the actual temp to be converted. I'm finding tons of options to print an output from this input but no options to take this input and then request a second input. I'm thinking I need to use functions to perform this but again not sure.
Thanks for any advice.
input_list = ["F", "C"]
P1 = input("Select F or C from: " + ' '.join(input_list) + "\n")
print (P1)