⬅︎ Back to Interesting float/int casting in Python
Pretty poor question but here is the answer: def replace(): while True: try: a = input(“Please enter a decimal or whole number”) float(a) print(“True”) except ValueError: print(“False”)replace()
Comment
Pretty poor question but here is the answer:
def replace():
while True:
try:
a = input(“Please enter a decimal or whole number”)
float(a)
print(“True”)
except ValueError:
print(“False”)
replace()