Commit 3caf1030 by ansire

panga ylessanne

parent 3f078ca9
Showing with 32 additions and 0 deletions
while True:
summa=int(input('Sisestage summa, mida soovite v2lja v6tta: '))
if summa>0 and summa%5==0:
break
else:
print("Summat %i ei ole v6imalik v2lja v6tta, sisestage 5ga jaguv summa" %(summa))
continue
kupyyrid=[500,200,100,50,20,10,5]
kogused=[0,0,0,0,0,0,0]
#print(summa)
while True:
if summa<=0:
break
for i in range(len(kupyyrid)):
if summa-kupyyrid[i]>=0:
summa-=kupyyrid[i]
kogused[i]+=1
elif summa<=0:
break
test=0
for i in range(len(kupyyrid)):
test+=kupyyrid[i]*kogused[i]
print('V2ljastatav summa {:d}€'.format(test))
print('V2ljastatavad kupyyrid:')
for i in range(len(kupyyrid)):
if kogused[i]==0:
continue
print('{:6d}€ - {:d}tk'.format(kupyyrid[i],kogused[i]))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment