PythonLab @MLK in the Digital Commons.
Introduction to Python (2.7) from 2-4PM
Please bring laptops if you have them, check the hackpad for text editor and text details!
DC Python Hackpad
Join or login to comment.
Here is what we did today!
0 · August 16, 2014
Regarding our change calculator, it occurred to me that by the time we get down to pennies, what we have left is our answer for pennies. We don't have to call process_change for pennies.
I realize that adding in code to test for "coin == 1" is probably adding more code than just keeping it the way it is, but if there was a way....
I did make this change, but it’s no more efficient:
for coin in changelist: print "coin is:", coin if coin == 1: res = str(amount_chg) + '' + str(coin) else: res = process_change(amount_chg, coin) amount_chg = res print "new amount_chg:", amount_chg coinlist.append(res) return coinlist
0 · August 17, 2014
for coin in [25,10,5]:[…]res = proc_change(amt_chg, coin)[…]amt_chg = res[…]coinlist.append(res)# after “for” amt_chg has to be penniescoinlist.append(str(amt_chg)+''+str(1))return coinlist
[…] ==> indent
You are very right Chad! You should totally send a pull request! https://help.github.co...
How do I post a job?
0 · August 12, 2014
Next: Invite friends
We promote and support the use of Python software in DC
Silver Level Donor
Bronze Level Donor
Access to O'Reilly Content, Book and Video Discount, Conference Discount
Individual Level Donor
2,152 Data Enthusiasts
5,163 Entrepreneurs and Startups
Meetup members, Log in