Basically I want to make a dice roller that allows me to take the # of times the user requests me to roll, and then multiply that by the print statement at the end, but I can't do this because it doesn't let me multiply my num_of_time variable as it is a string? If you have a better way of doing this, please let me know.
import random
class DiceRoll:
def __init__(self):
pass
def diceroll(self):
print(random.randint(1,6))
d = DiceRoll()
answer = input("Do you want to roll a dice? ")
if answer == "yes":
d.diceroll()
else:
print("You suck")
answer = input("Would you like to roll again? ")
if answer == "yes":
num_of_time = input("How many times would you like to roll : ")
else:
print("You suck")
print(random.randint(1,6)) *