[challenge] change calculator 12-22-2015, 05:06 AM
#1
This is a pretty quick one. All you need to do is make a method that accepts a float and prints out the change values for it.
Example IO:
Example IO:
Code:
#In:
calc(546.24)
#Out:
$100: 5
$50: 0
$20: 2
$10: 0
$5: 1
$2: 0
$1: 1
$0.25: 0
$0.10: 2
$0.05: 0
$0.01: 4Spoiler: Example Solution (python)
Code:
def calc(c):
for i in [100,50,20,10,5,2,1,0.25,0.10,0.05,0.01]:
print '$%s: \t%s'%(i,int(c//i))
c=c%iIt's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.
don't have much in the first place, who feel the new currents and ride them the farthest.

















![[+]](https://sinister.li/images/modern/collapse_collapsed.png)



