Python Forum
Program debugging (python)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program debugging (python)
#3
(Jan-17-2019, 04:01 AM)ichabod801 Wrote: I don't get that error. I get a later error on line 11, because you never convert the strings to integers. I think you want to replace the str call on line 47 to an int call. And you need to be careful about your input. If you don't input 9 numbers with spaces in between them, you'll get the error you got.

I replace str with int and now the line looks like this.
square[i].append(int(str_list[j + i * N]))
However, when i input 1 2 3 4 5 6 7 8 9 i get this error: for line 11
TypeError: unsupported operand type(s) for +: 'int' and 'str'
Reply


Messages In This Thread
Program debugging (python) - by abdullahali - Jan-17-2019, 03:45 AM
RE: Program debugging (python) - by ichabod801 - Jan-17-2019, 04:01 AM
RE: Program debugging (python) - by abdullahali - Jan-17-2019, 04:15 AM
RE: Program debugging (python) - by ichabod801 - Jan-17-2019, 04:22 AM
RE: Program debugging (python) - by abdullahali - Jan-17-2019, 04:26 AM
RE: Program debugging (python) - by ichabod801 - Jan-17-2019, 04:31 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python debugging hw John0895 10 5,593 Oct-11-2018, 10:28 AM
Last Post: Phrotonz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020