+ 1

Feet to Inches Converter

Can anyone help me with this task? Need to make conversation foot to inches. 1 foot = 12 inches. I think that need use input inside function, but i do not sure...please help mb like this?: feet = int(input()) def convert(feet): feet = feet * 12 return convert print(convert(feet))

2nd Jun 2021, 4:30 PM
Andrey Zinin
5 Réponses
+ 6
return feet
2nd Jun 2021, 4:38 PM
TOLUENE
TOLUENE - avatar
+ 5
to make it a bit more clear and simple you can use it like this: 🙂 def convert(feet): return feet * 12
2nd Jun 2021, 6:46 PM
Lothar
Lothar - avatar
+ 5
Lothar 's solution is the simplest. If you are going to use your function, you need to correct it like this: def convert(feet): inches = feet * 12 return inches
3rd Jun 2021, 2:30 AM
David Ashton
David Ashton - avatar
+ 3
just an enhancement: use feet *= 12
2nd Jun 2021, 4:59 PM
Rellot's screwdriver
Rellot's screwdriver - avatar
0
Thank you so much!!!
2nd Jun 2021, 4:46 PM
Andrey Zinin