Nov-15-2019, 03:05 PM
Hello, I am the biggest noob in this forum probably, so my first question is why this simple if-statement allways
accepts the first if-statement regardless of what i put in to the 'unit' variable?
accepts the first if-statement regardless of what i put in to the 'unit' variable?
weight = float(input(f'Weight: ')) unit = input('[L]bs or [K]g: ').lower() if unit == 'k' or 'kg': print(f'weight is {weight / 0.45} pounds') elif unit == 'l' or 'lbs': print(f'weight is {weight * 0.45} kg') else: print('Invalid unit of measurement')thx