-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (36 loc) · 841 Bytes
/
Copy pathmain.py
File metadata and controls
40 lines (36 loc) · 841 Bytes
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
#!/usr/bin/python
print ("Prosty kalkulator Python\n" \
"Wybierz opcje:\n" \
"1. Dodawanie\n" \
"2. Odejmowanie\n" \
"3. Mnozenie\n" \
"4. Dzielenie\n" \
"0. Wyjscie\n\n")
option = int(input("Wybierz opcje: "))
if option == 1:
a = int(input("Podaj pierwsza liczbe: "))
b = int(input("Podaj druga liczbe: "))
print("\nWynik: ")
print (a + b)
exit()
elif option == 2:
a = int(input("Podaj pierwsza liczbe: "))
b = int(input("Podaj druga liczbe: "))
print("\nWynik: ")
print (a - b)
exit()
elif option == 3:
a = int(input("Podaj pierwsza liczbe: "))
b = int(input("Podaj druga liczbe: "))
print("\nWynik: ")
print (a * b)
exit()
elif option == 4:
a = int(input("Podaj pierwsza liczbe: "))
b = int(input("Podaj druga liczbe: "))
print("\nWynik: ")
print (a / b)
exit()
else:
print("Nie ma takiej opcji w menu!")
exit()