Thursday, 12 September 2013

Python if loop with multiple variables

Python if loop with multiple variables

The code im trying to create is to print a wavelength such as radio waves
or microwaves based on the wavelength value input.
userInput = input("Enter wavelength (m) value: ")
waveValue= float(userInput)
if waveValue >10*-1 :
print("Radio Waves")
elif waveValue >10*-1<10*-3 :
print("Microwaves")
Any hints on how I can get the second if statement to work. Every input I
put in just outputs radio waves because my arguments does not work
properly.

No comments:

Post a Comment