Cube/main.py
2023-03-28 12:29:16 +02:00

19 lines
556 B
Python

#!/usr/bin/python3
import random
cube = 'Würfel-Generator\nZum Würfeln die 1 Drücken.'
print(cube.center(54))
def cube():
while True:
try:
entry = int(input('1 drücken zum Würfeln.\n'))
#entry = int(entry)
if entry == 1:
print(random.randint(1, 6))
elif entry > 1:
print('Ups! Da wurde nicht die 1 gedrückt. Bitte nochmal versuchen.\n')
except ValueError:
print('Ups! Da wurde nicht die 1 gedrückt. Bitte nochmal versuchen.\n')
cube()