Project :Weight Converter
1.-weigth=int (input('Weight: '))
You can NOT multiply a string for a floating number
2.-unit = input('(L)bs or (K)gs ')
3.-if unit.upper() == "L"
The # 3 statement is a string because the input function always return a string To make sure everything is a capital letter
4.-converted = weight * 0.45
weight is a string object and we can not multiply by floating number, so we make the variable called "converted"
5.-print(f'" You are {converted}Kilos")
6.-else:
converted = weight / 0.45
The division will give you a floating number but if you use // you will get an integer)
7.-print(f" you are {converted} pounds")
Project :Weight Converter
Reviewed by ohhhvictor
on
May 05, 2019
Rating:
No comments: