Total beginner here,
I'm writing a program that rolls dice for the user, and I want it to be able to change the number of faces of the die per user input. I can't seem to get the variable amount_faces to work as an int for the randint() function, I get a "TypeError: cannot concatenate 'str' and 'int' objetcts" error everytime:
from sys import exit
from random import randint
def start():
print "Would you like to roll a dice?"
choice = raw_input(">")
if "yes" in choice:
roll()
elif "no" in choice:
exit()
else:
print "I can't understand that, try again."
start()
def roll():
print "How many faces does the die have?"
amount_faces = raw_input(">")
if amount_faces is int:
print "The number of faces has to be an integer, try again."
roll()
else:
print "Rolling die...."
int(amount_faces)
face = randint(1,*amount_faces)
print "You have rolled %s" % face
exit()
start()
Any clues?