Как бы я напечатал randint несколько раз, чтобы он не печатал одно и то же число несколько раз? ⇐ Python
Как бы я напечатал randint несколько раз, чтобы он не печатал одно и то же число несколько раз?
I'm fairly new to python and I'm trying to make a small dice rolling program. I'm trying to get a randint printed multiple times without it being the same number multiple times. Sorry if it's a stupid question
from random import randint dice_sides = input("Input the dice that you want rolled") #use the format "dx" where d stands for dice and x is represents the sides of the dice for ex. "d20" num = int(input("Input the number of dice you want rolled")) if dice_sides == "d20": print(str(randint(1, 20))* num)
Источник: https://stackoverflow.com/questions/780 ... e-number-m
I'm fairly new to python and I'm trying to make a small dice rolling program. I'm trying to get a randint printed multiple times without it being the same number multiple times. Sorry if it's a stupid question
from random import randint dice_sides = input("Input the dice that you want rolled") #use the format "dx" where d stands for dice and x is represents the sides of the dice for ex. "d20" num = int(input("Input the number of dice you want rolled")) if dice_sides == "d20": print(str(randint(1, 20))* num)
Источник: https://stackoverflow.com/questions/780 ... e-number-m
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение