0

What's wrong with my code?

ip = input() num = int(input()) if str(ip) == 'inches': print(str(num*12)) elif str(ip) == 'feet': print(str(num/12)) Thx so much

1st Nov 2021, 1:36 PM
Elliot
Elliot - avatar
7 Respuestas
+ 2
Try if ip == "inches" : and elif ip == "feet" :
1st Nov 2021, 1:40 PM
Coding Cat
Coding Cat - avatar
+ 2
For me it's working. Did you make the input right.? feet [ENTER] 5 [SUBMIT]
1st Nov 2021, 1:58 PM
Coding Cat
Coding Cat - avatar
+ 2
Ok thank you, cuz I wasn't letting me make a separate line, I would hit enter and nothing would happen
1st Nov 2021, 7:33 PM
Elliot
Elliot - avatar
+ 1
Thx
1st Nov 2021, 1:45 PM
Elliot
Elliot - avatar
+ 1
For some reason it is still giving me an EOF error for the second input. I don't know why.
1st Nov 2021, 1:47 PM
Elliot
Elliot - avatar
- 1
Write a python code to this pattern ? 1 12 123 1234 12345
2nd Nov 2021, 2:29 PM
RISHABH VARSHNEY