Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lab_III_2_01_12_2020
#python 3.6.9 print ("Hello, world!") def GCD_recursive(n, m): if m == 0: return n else: return GCD_recursive(m, n % m) print(GCD_recursive(12, 8)) """ Team 1: Amen Mekonnen Bekele, Anh Tuan Nguyen, Arman Kitarov Team 2: Aruzhan Seitzhapparova, ASKAR OSMONOV, Divyal Zala Team 3: Enes Gunay, Firdavs Sattorov, Giribambe Karasira Team 4: Illia Movchan, Ismail Shora, Mahdi Vahedian Team 5: Malick Guindo, Mohammad Maaz, Nikhil Sonawane Team 6: Nizam Mamedov, Rajeeth Shetty, Srinivasan Dvhisvalinagam Team 7: Tafadzwa Muchenje, Temesgen Baraki, Ukbe Yahsi Team 8: Usman Aftab, Vladyslav Dashutin , Marvin Keene Dua """ def GCD_iterative_1(n, m): a = 0 while m !=0: a = m m = n%m n = a return n def GCD_iterative_2(n, m): pass def GCD_iterative_3(n, m): def GCD_iterative_4(n, m): while(n != m): if(n > m): n -= m else: m -= n return n def GCD_iterative_4_V2(n,m): c=1 while(True): if (c>=n and c>=m): break elif (n%c==0 and m%c==0): g=c c=c+1 return g def GCD_iterative_5(n, m): if(m == 0): return n else: return GCD_iterative_5(m,n%m) def GCD_iterative_6(n, m): pass def GCD_iterative_7(n, m): alist = [] blist = [] GCDval = 1 for i in range(1,a+1): if a%i==0: alist.append(i) for i in range(1,b+1): if b%i==0: blist.append(i) for i in alist: for j in blist: if j == i: GCDval = j return GCDval def GCD_iterative_8(n, m): pass def main(): m = 8 n = 12 print(GCD_iterative_1(n, m)) print(GCD_iterative_2(n, m)) print(GCD_iterative_3(n, m)) print(GCD_iterative_4(n, m)) print(GCD_iterative_5(n, m)) print(GCD_iterative_6(n, m)) print(GCD_iterative_7(n, m)) print(GCD_iterative_8(n, m)) main()
run
|
edit
|
history
|
help
0
Asdf
Add missing persons
string length
PYTHON 3 ÖDEV :)
Prime_list
we
list_copy_shallow_deep.py
intervalos
134
Hesap makinesi