Hi all,
I was trying out to write a small prog to prompt the user input for numbers...
I used the isdigit func to check whether the input is a number or string... it works but this doesn't accept float as a number... how can i do to make it works for both integer and float?
while True:
n1 = input("Enter the first number: ")
if n1.isdigit() == False:
print("Invalid input!")
else:
n1 = int(n1)
break