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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 32 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 32 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply