-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2-calculator.py
More file actions
38 lines (33 loc) · 1.19 KB
/
2-calculator.py
File metadata and controls
38 lines (33 loc) · 1.19 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
print("""****************************
Hesap Makinesi Programı
İşlemler;
1. Toplama
2. Çıkarma
3. Çarpma
4. Bölme
Çıkış içim "q" tuşuna basın..
****************************""")
while True:
işlem = input("İşlem seçiniz: ")
if (işlem == "q"):
print("Program Kapatılıyor")
print("Güle güle!")
break
elif (işlem =="1"):
sayı_1 = int(input("Birinci Sayı: "))
sayı_2 = int(input("İkinci Sayı: "))
print("{} ile {} sayısının toplamı {}'dır".format(sayı_1, sayı_2, sayı_2+sayı_1))
elif (işlem =="2"):
sayı_1 = int(input("Birinci Sayı: "))
sayı_2 = int(input("İkinci Sayı: "))
print("{} - {} : {}'dır".format(sayı_1, sayı_2, sayı_1 - sayı_2))
elif (işlem =="3"):
sayı_1 = int(input("Birinci Sayı: "))
sayı_2 = int(input("İkinci Sayı: "))
print("{} x {} : {}'dır".format(sayı_1, sayı_2, sayı_2 * sayı_1))
elif (işlem =="4"):
sayı_1 = int(input("Birinci Sayı: "))
sayı_2 = int(input("İkinci Sayı: "))
print("{} / {} : {:.2f}'dır".format(sayı_1, sayı_2, sayı_1 / sayı_2))
else:
print("Geçersiz İşlem")