def game():
while True:
try:
number_of_dices = int(input('Please select how many dices do you want to use: '))
except ValueError:
print('Please enter a number')
continue
break
while True:
try:
s = int(input('How many sides on your dice? '))
except ValueError:
print('Number of sides must be a number.')
continue
break
rolls = []
def dice_roll(number_of_dices):
for i in range(number_of_dices):
dice_roll = random.randint(1, s)
rolls.append(dice_roll)
print(dice_roll, end=' ')
print(dice_roll(number_of_dices))
print('\nTotal number is: ',sum(rolls))
while True:
game()
restart = input('Do you want to restart? Y/N ')
if restart == 'N' or 'n':
break
elif restart == 'Y' or 'y':
continue
I am doing a little terminal game. I am new to Python (2 weeks) and got stuck with None at the end of print. Now, I know it's because my function doesn't return so I get None. I can remove print and type return there but then it won't print a result from each particular dice and that's a thing I want to keep, so the end Player can see what number was on each dice and a total number. Just have no idea how to do it.
Trying to achieve exactly the same as on the picture but without None.