This seems like a problem that is easy to find on the internet, but nothing fixes the problem. I am creating a dice rolling program that lets you choose the number of dice you want to roll, but it keeps giving me an error when I type anything that's not an integer: 'ValueError: invalid literal for int() with base 10'
Here's my code:
print("Dice Rolling Simulator 1.0")
def functionStart():
diceAmount = input("How many dice would you like to roll? (we recomend less than 6): ")
if int(diceAmount) == int:
print("true")
else:
print("Please enter a number such as '3' or '7'. It is not rocket science")
functionStart()
functionStart()
I'm simply trying to verify that they typed an integer. The converted number will also be used to generate the number of dice rolled later in the program. What am I doing wrong?