Mar-30-2017, 01:53 PM
(Mar-30-2017, 03:29 AM)wavic Wrote: Hello!
Just ask the user for the temperature. Then print temperature to F, new line, temperature to C
Indentation of your code is wrong. The input is too complicated
P1 = input("Convert to C/F (select one): ") print (P1)Comma instead of slash would be better: C, F
Thanks for the advice that worked out great.
This is what my code looks like now. I've tested it and it works.
If I wanted this to loop so they could come back and after they convert one temp convert a second by simply entering C again. I'd need a loop to perform this action correct? Again sorry for the n00b questions.
P1 = input("Convert to C,F (select one): ") print (P1) if P1 == "c": Temp = int(input("What is your temperature?")) print((Temp * (9/5)) + 32) elif P1 == "f": Temp = int(input("What is your temperature?")) print((Temp - 32) * (5/9))