I have a while loop like so:
while True:
try:
h = int(raw_input("Please Enter your altitude in metres > "))
if h > 0 and h < 11000:
phase = 'Troposphere'
break
except ValueError:
print 'Your entered value contained letters or punctuation. Please enter a numerical value.'
and later I want to use the values for h
and phase
but my IDE is telling me it cannot be defined. The values are being used in a calculation and the phase is printed.