• API
• FAQ
• Tools
• Archive
SHARE
TWEET # Untitled a guest Jun 25th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. import math
2.
3. def sito(n):
4.     numbers = [i for i in range(2,n,1)]
5.     print(numbers)
6.     num = numbers
7.     i=0
8.     num=numbers[i]
9.
10.     while(True):
11.
12.         if(num>math.sqrt(n)):
13.             break
14.         numbers =[numb for numb in numbers if (numb%num != 0 or numb<=num)]
15.
16.         i+=1
17.         if(i>len(numbers)):
18.             break
19.         num=numbers[i]
20.     return numbers
21.
22.
23.
24. def NWD(a, b):
25.     if (b > a):
26.         a, b = b, a
27.     t=0
28.     while (b != 0):
29.         t = (a - int(a / b)*b)
30.         #print(t)
31.         a = b
32.         b = t
33.         #print(b)
34.         #print(a)
35.     return a
36.
37.
38.
39.
40.
41. a =1920
42. b =162
43.
44. #print(x,y)
45. print(NWD(1920,162))
46. #print(sito(30))
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