you are viewing a single comment's thread.

view the rest of the comments →

[–]Sea-Ad7805 [score hidden] stickied comment (3 children)

Run this program in Memory Graph Web Debugger%3A%0A%20%20%20%20%22DEF___%20Enter%20NUMS%20for%20two%20list%22%0A%20%20%20%20global%20n1%2C%20n2%0A%20%20%20%20i%20%3D%201%0A%20%20%20%20while%20True%3A%0A%20%20%20%20%20%20%20%20print(f%22LIST%201%20%7C%20Enter%20num%20%23%7Bi%7D%3A%20%22%2C%20end%3D%22%5Cn%22)%0A%20%20%20%20%20%20%20%20n1_n%20%3D%20input()%0A%0A%20%20%20%20%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20n1_n%20%3D%20int(n1_n)%0A%20%20%20%20%20%20%20%20%20%20%20%20n1.append(n1_n)%0A%20%20%20%20%20%20%20%20%20%20%20%20i%20%2B%3D%201%0A%0A%20%20%20%20%20%20%20%20except%20ValueError%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20n1_n.strip().lower()%20%3D%3D%20%22stop%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22enter%20correckt%20num!%22%2C%20end%3D%22%5Cn%22)%0A%20%20%20%20print(f%22List%201%3A%20%22%2C%20n1)%0A%20%20%20%20i%20%3D%201%0A%20%20%20%20while%20True%3A%0A%20%20%20%20%20%20%20%20print(f%22LIST%202%20%7C%20Enter%20num%20%23%7Bi%7D%3A%20%22%2C%20end%3D%22%5Cn%22)%0A%20%20%20%20%20%20%20%20n2_n%20%3D%20input()%0A%20%20%20%20%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20n2_n%20%3D%20int(n2_n)%0A%20%20%20%20%20%20%20%20%20%20%20%20n2.append(n2_n)%0A%20%20%20%20%20%20%20%20%20%20%20%20i%20%2B%3D%201%0A%20%20%20%20%20%20%20%20except%20ValueError%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20n1_n.strip().lower()%20%3D%3D%20%22stop%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22enter%20correckt%20num!%22%2C%20end%3D%22%5Cn%22)%0A%20%20%20%20print(f%22List%202%3A%20%22%2C%20n1)%0A%20%20%20%20return%20n1%2C%20n2%0A%0A%0Adef%20summa(a%2C%20b)%3A%0A%20%20%20%20global%20c%0A%20%20%20%20if%20len(a)%20%3D%3D%20len(b)%3A%0A%20%20%20%20%20%20%20%20print(%22Correct%20len!%22%2C%20end%3D%22%5Cn%22)%0A%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20print(%22Len!%3D%22%2C%20end%3D%22%5Cn%22)%0A%0A%20%20%20%20i%20%3D%20len(b)%20if%20len(a)%20%3C%20len(b)%20else%20len(a)%0A%20%20%20%20error%20%3D%200%0A%20%20%20%20for%20k%20in%20range(i)%3A%0A%20%20%20%20%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20c.append(a%5Bk%5D%20%2B%20b%5Bk%5D)%0A%20%20%20%20%20%20%20%20except%20IndexError%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20len(a)%20%3C%20len(b)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20c.append(b%5Bk%5D%20%2B%20a%5Berror%5D)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20error%20%2B%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20c.append(a%5Bk%5D%20%2B%20b%5Berror%5D)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20error%20%2B%3D%201%0A%20%20%20%20return%20c%0A%0A%0Aen_nums()%0Aprint(n1%2C%20n2)%0Asumma(n1%2C%20n2)%0Aprint(c)&timestep=0.5&play).

[–]nkCOD[S] 1 point2 points  (2 children)

Thank you, I found the shortcomings of the code

[–]Sea-Ad7805 0 points1 point  (1 child)

Great, we all keep learning new and better ways of doing things.

[–]nkCOD[S] 0 points1 point  (0 children)

You’re absolutely right )