2021-12-01から1日間の記事一覧
pythonコード import random roll = 0 count = 0 while roll != 5: count = count + 1 roll = random.randint(1, 5) print(roll) print('It took {count} rolls to roll a 5!') Output 2225It took 4 rolls to roll a 5! random関数をインポートすることでラ…
pythonコード import random roll = 0 count = 0 while roll != 5: count = count + 1 roll = random.randint(1, 5) print(roll) print('It took {count} rolls to roll a 5!') Output 2225It took 4 rolls to roll a 5! random関数をインポートすることでラ…