-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtaban_cevir.py
More file actions
27 lines (21 loc) · 818 Bytes
/
taban_cevir.py
File metadata and controls
27 lines (21 loc) · 818 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
#######################################################
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# 10'TABANINDAN #
# 2'TABANINA ÇEVİREN #
# PROGRAM #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#######################################################
def tabanCevir(bolunen , bolen): # 2 TABANI SABİT!
kalan = []
while(True):
ilkBolum = int(bolunen / bolen)
kalan.append(bolunen - (bolen * ilkBolum))
bolunen = ilkBolum
if ilkBolum < bolen:
kalan.append(ilkBolum)
kalan.reverse()
return kalan
break
print('**** İŞLEM SONUCU ****')
for i in tabanCevir(20,2):
print(i,end="")