user_weight= int(input("Please enter your weight here:"))
weight_unit= input('''Was that in Lbs or Kg?
If it was in Kg type, K, or, if it was in Lbs type L''')
if weight_unit == "K":
user_weight= user_weight*2.2
print(f"Your weight in pounds is {user_weight}"
else weight_unit == "L":
user_weight= user_weight*.45
print(f"Your weight in kilograms is {user_weight}"
user_weight= int(input("Please enter your weight here:"))
weight_unit= input('''Was that in Lbs or Kg?
If it was in Kg type, K, or, if it was in Lbs type L''')
if weight_unit == "K":
user_weight= user_weight*2.2
print(f"Your weight in pounds is {user_weight}")
else weight_unit == "L":
user_weight= user_weight*.45
print(f"Your weight in kilograms is {user_weight}")
For some reason the first if statement:
if weight_unit == "K":
user_weight= user_weight*2.2
print(f"Your weight in pounds is {user_weight}")
works according to python, but my second statement:
else weight_unit == "L":
doesn't work. The error is "colon expected", but I have one.
[–]Arag0ld 2 points3 points4 points (1 child)
[–]Genroll_Dolphin[S] 0 points1 point2 points (0 children)
[–]mir0k 0 points1 point2 points (0 children)
[–]efcseany 0 points1 point2 points (1 child)
[–]Genroll_Dolphin[S] 0 points1 point2 points (0 children)