toss_number = input("How many times do you want to toss the coin?\n")
while True:
if toss_number.isdigit():
break
else:
toss_number = input("Please input NUMBER of times you want to toss a coin.\n")
These lines of code essentially make sure that toss_number contains a string of numbers. Is there a better/more efficient way of doing this?