File tree 2 files changed +36
-1
lines changed
2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -8,4 +8,5 @@ Copyright (c) 2020 Ercan Ersoy
8
8
9
9
* [ Hello World] ( hello-world )
10
10
* [ User Input] ( user-input )
11
- * [ Circle Calculator] ( circle-calculator )
11
+ * [ Circle Calculator] ( circle-calculator )
12
+ * [ Simple Calculator] ( simple-calculator )
Original file line number Diff line number Diff line change
1
+ while True :
2
+ print ("1. Addition" )
3
+ print ("2. Substraction" )
4
+ print ("3. Multiplication" )
5
+ print ("4. Division" )
6
+ print ("5. Exit" )
7
+ choice = input ("Your choice: " )
8
+
9
+ if choice == "1" :
10
+ first_addend = float (input ("First addend: " ))
11
+ second_addend = float (input ("Second addend: " ))
12
+ print ("Result: " , end = "" )
13
+ print (first_addend + second_addend )
14
+ elif choice == "2" :
15
+ first_subtrahend = float (input ("First subtrahend: " ))
16
+ second_subtrahend = float (input ("Second subtrahend: " ))
17
+ print ("Result: " , end = "" )
18
+ print (first_subtrahend - second_subtrahend )
19
+ elif choice == "3" :
20
+ multiplier = float (input ("Multiplier: " ))
21
+ multiplicand = float (input ("Multiplicand: " ))
22
+ print ("Result: " , end = "" )
23
+ print (multiplier * multiplicand )
24
+ elif choice == "4" :
25
+ dividend = float (input ("Dividend: " ))
26
+ divider = float (input ("Divider: " ))
27
+ print ("Result: " , end = "" )
28
+ print (dividend / divider )
29
+ elif choice == "5" :
30
+ break
31
+ else :
32
+ print ("Wrong choice!" )
33
+
34
+
You can’t perform that action at this time.
0 commit comments