Page 1 of 1

Help I am failing the 4th. How do I fix.

Posted: Mon Jun 06, 2022 5:13 pm
by answerhappygod
Help I am failing the 4th. How do I fix.
Help I Am Failing The 4th How Do I Fix 1
Help I Am Failing The 4th How Do I Fix 1 (24.83 KiB) Viewed 34 times
Help I Am Failing The 4th How Do I Fix 2
Help I Am Failing The 4th How Do I Fix 2 (15.32 KiB) Viewed 34 times
123456T 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 def plusOne (digits): i = len (digits) - 1; out = [] temp = digits + 1 while (True): if (temp == 10): else: out.insert(0, 0); carry = 1; out.insert(0, temp); carry = 0 i=i-1; if (i < 0): break; temp = digits + carry; return out;

Calling with Arguments Name Arguments Actual pass plusOne [1, 2, 3] [1, 2, 4] [1, 2, 4] pass plusOne [1, 4, 9] [1, 5, 0] [1, 5, 0] pass plusOne [0] [1] [1] fail plusOne [9, 9, 9, 9] [0, 0, 0, 0] [1, 0, 0, 0, 0] Expected