-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
56 lines (43 loc) · 1.4 KB
/
main.py
File metadata and controls
56 lines (43 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# GitHub Link: https://github.com/PaidPopcornRub/TaschenmesserPythonCLI
import random
def Intro():
print("--- Taschenrechner ---")
print("Willkommen zum Taschenrechner, bitte gebe an was du machen willst.")
print(
"\n1. Zufallszahl\n2. Taschenrechner\n3. Irgendwas\n4. Münze werfen\n5. Programm stoppen"
)
def Menue():
print("--- Taschenrechner ---")
print("Willkommen zum Taschenrechner, bitte gebe an was du machen willst.")
print(
"\n1. Zufallszahl\n2. Taschenrechner\n3. Irgendwas\n4. Münze werfen\n5. Programm stoppen"
)
def Programme():
if tool == str(1):
numOne = int(input("Gebe eine Zahl ein: "))
numTow = int(input("Gebe eine Zahl ein: "))
randomNumber = random.randint(numOne, numTow)
print(randomNumber)
elif tool == str(2):
rechnung=input("Was möchtest du rechnen? ")
ergebniss=eval(rechnung)
print("Dein Ergebniss ist:", ergebniss)
elif tool == str(3):
irgendwas=random.randint(1,4)
print("Nimm doch nächstes mal", irgendwas, "!")
elif tool == str(4):
print("Ich werfe jetzt eine Münze")
coin = random.randint(1, 2)
if coin == 1:
print("Das Ergebniss ist Kopf")
else:
print("Das Ergebniss ist Zahl")
elif tool == str(5):
print("Bis zum nächsten mal!")
exit()
else:
print("---")
print("Bitte gebe eine Valide eingabe ab!")
Intro()
tool=input("Worauf hast du lust? ")
Programme()