-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSecond calculator.py
36 lines (34 loc) · 995 Bytes
/
Second calculator.py
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
# Calculator
import math
import emoji
action = float
while action != 0:
action = input("Tell the action you want. '0' to exit\n")
if action == '0':
print(emoji.emojize('You choose to exit\nBye!:waving_hand:'))
break
if action == '!':
num3 = int(input('Type any integer number '))
print(math.factorial(num3))
num = float(input('Type any number '))
if action == 'log':
print(math.log(num))
num2 = float(input('Type another number '))
if action == '+':
action = num + num2
print(action)
if action == '-':
action = num - num2
print(action)
if action == '*':
action = num * num2
print(action)
if action == '**':
action = num ** num2
print(action)
if action == '/':
action = num / num2
print(action)
if action == '%':
action = (num / (num2*10)) * 100
print('{}%'.format(action))