Jul-29-2019, 10:57 AM
I have changed the relevant code to be as such after debugging it:
whatIsOwedBack = anythingLeft * -1 listOfWhatIsOwedBack = [i for i in str(whatIsOwedBack)] if (listOfWhatIsOwedBack[-1] == "1" or listOfWhatIsOwedBack[-1] == "2"): listOfWhatIsOwedBack[-1] = "0" elif (listOfWhatIsOwedBack[-1] == "3" or listOfWhatIsOwedBack[-1] == "4" or listOfWhatIsOwedBack[-1] == "6" or listOfWhatIsOwedBack[-1] == "7"): listOfWhatIsOwedBack[-1] = "5" else: listOfWhatIsOwedBack[-1] == "8" or listOfWhatIsOwedBack[-1] == "9" listOfWhatIsOwedBack[-1] = "0" print(listOfWhatIsOwedBack)After following the link and taking the suggestions into account, it appears that nothing has changed, except that it seems to have stopped reading the code after either print statement, not even reading the variable listOfWhatIsOwedBack.
afterPennyAbolishCoinsLeftAfterCheck() Enter the floating point numbers representing the item cost and the amount paid respectively 302.57 3.03 Here's your change: 0.0 100$ Bill(s), 0.0 50$ Bill(s), 0.0 20$ Bill(s), 1.0 Toonie(s), 0.0 Loonies, 3.0 Quarter(s), 2.0 Dime(s) and 0.0 Nickel(s)