Skip to content

Instantly share code, notes, and snippets.

@pwnall1337
Created April 28, 2017 06:54
Show Gist options
  • Save pwnall1337/702b3404d66616c9c63b280775181301 to your computer and use it in GitHub Desktop.
Save pwnall1337/702b3404d66616c9c63b280775181301 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
def change(owed):
owed=str(owed)
dollar=owed.split('.')[0]
change=owed.split('.')[1]
am=dollar+change
am=int(am)
print am
q=25
d=10
n=5
p=1
change_list=[]
while am > 0:
while am >=q:
am=am-q
print am
change_list.append(q)
while am >=d:
am=am-d
print am
change_list.append(d)
while am >=n:
am=am-n
print am
change_list.append(n)
while am >=p:
am=am-p
print am
change_list.append(p)
return change_list
print change(1.45)
pwnall@pwnall-desktop:~$ python google.py
145
120
95
70
45
20
10
0
[25, 25, 25, 25, 25, 10, 10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment