My current code:
while True:
surjuv = input("What is the juvenile survival rate?")
if surjuv.isinstance(float)==True and float(surjuv)<=1 and float(surjuv)>=0:
break
It needs to make sure that surjuv
is a float, but the following error comes up when 0.5 is entered:
Traceback (most recent call last):
File "python", line 81, in <module>
File "python", line 21, in main_menu
File "python", line 51, in enter_gen0
AttributeError: 'str' object has no attribute 'isinstance'