Apr-24-2020, 07:30 AM
Python Tutorial for Beginners [Full Course] Learn Python for Web Development
can you help me with the following code: above is youtube video.
you know how you have a weight and unit excersice under if statement in this video above. i was trying that user should only enter "K" or "L for unit of weight and untill they dont enter "K" or " L" terminal should keep asking for the right unit. Please help.
(Python)
weight = int(input("weight: "))
unit = input("(L)bs or (K)g: ")
if unit.upper() == "l":
converted = weight * 0.45
print(f"you are {converted} Kilos")
else:
converted = weight / 0.45
print(f"You are {converted} Pounds.")
can you help me with the following code: above is youtube video.
you know how you have a weight and unit excersice under if statement in this video above. i was trying that user should only enter "K" or "L for unit of weight and untill they dont enter "K" or " L" terminal should keep asking for the right unit. Please help.
(Python)
weight = int(input("weight: "))
unit = input("(L)bs or (K)g: ")
if unit.upper() == "l":
converted = weight * 0.45
print(f"you are {converted} Kilos")
else:
converted = weight / 0.45
print(f"You are {converted} Pounds.")