• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# slide(functions,recursions)

ayshan Apr 23rd, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. #1
2. def ebob(x,y):
3.     for i in range (1,x+1):
4.         if x%i==0 and y%i==0:
5.             ebob=i
6.     return ebob
7.
8. if int(ebob(5,6))==1:
10. else:
12.
13. #2
14. def perfect():
15.     cem=0
16.     a=int(input())
17.     for d in range (1,a):
18.         if a%d==0:
19.             cem+=d
20.     if cem==a:
21.         print("perfect")
22.     else:
23.         print("not perfect")
24. perfect()
25.
26. #3
27. def calculator():
28.     a=int(input("1ci ededi daxil et:"))
29.     b=int(input("2ci ededi daxil et:"))
30.     c=int(input("choose the options: 1-toplama 2-cixma 3-vurma 4-bolme"))
31.     if c==1:
32.         return a+b
33.     elif c==2:
34.         return a-b
35.     elif c==3:
36.         return a*b
37.     else:
38.         return a/b
39. print(calculator())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top