id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

david.white@denison.edu cs111fall2019 > changes
prev  |  next  |  chance

More change we can believe in! This exercise is just like the previous exercise, change, except that instead of returning the number of different ways to make change, the function changes(amt) returns a list of the different ways. For example, changes(10) should return [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 5], [5, 5], [10]]. The list should be in sorted order, as should each element of the list.


changes(10) → [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 5], [5, 5], [10]]
changes(0) → [[]]
changes(4) → [[1, 1, 1, 1]]

...Save, Compile, Run (ctrl-enter)

def changes(amt):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 501 Post-solution available

Copyright Nick Parlante 2017 - privacy