forked from IEEE-VIT/playing-with-numbers-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
31 lines (28 loc) · 638 Bytes
/
app.py
File metadata and controls
31 lines (28 loc) · 638 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
def add():
x = input("Enter your number 1")
y = input("Enter your number 2")
z = x+y
print("Your final result is: ", z)
def multiply():
x = input("Enter your number 1")
y = input("Enter your number 2")
z = x*y
print("Your final result is: ", z)
def factorial():
# Take an integer as an input and
# Return it's factorial
def prime():
x = input("Enter a number:")
fac = 1
if x<0:
print("factorial not possible")
elif x==0:
print("factorial is 1)
else:
for i in range(1,num + 1):
fac = fac * i
print("factorial is:",fac)
if __name__=='__main__':
add()
multiply()
factorial()