Python Forum
semantic error log function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
semantic error log function
#11
1. If you don't get NameError for xx then you have defined it somewhere outside the code you show to us.
2. You assign xx to a0 and then append xx to cc
3. In the code shown you never change xx - as a result you append same value of xx over and ove again.
4. On line 10 you reset cc in every iteration of the loop.
5. As a result of 3 and 4 cc has only one value always - original/initial value of xx that we know nothing about. So why cc is a list at all?
6. On line 12 you refer to cc[1][1], but as we see from 4 it has only 1 value so only c[0], i.e. 1 is invalid index for cc - that is why you get your error
7. given that you use cc[1][1], c[0][1], c[-1][-1] and the one and only element is cc is actually xx I would guess xx is a list with unknown number of elements (as we said multiple times in your code it is defined somewhere else, so we don't know about it)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
semantic error log function - by mcgrim - Apr-23-2019, 12:54 PM
RE: semantic error log function - by ichabod801 - Apr-23-2019, 01:45 PM
RE: semantic error log function - by mcgrim - Apr-23-2019, 06:16 PM
RE: semantic error log function - by ichabod801 - Apr-23-2019, 06:58 PM
RE: semantic error log function - by mcgrim - Apr-23-2019, 07:12 PM
RE: semantic error log function - by ichabod801 - Apr-23-2019, 07:24 PM
RE: semantic error log function - by mcgrim - Apr-23-2019, 07:29 PM
RE: semantic error log function - by buran - Apr-24-2019, 08:32 AM
RE: semantic error log function - by mcgrim - Apr-24-2019, 08:34 AM
RE: semantic error log function - by buran - Apr-24-2019, 08:50 AM
RE: semantic error log function - by mcgrim - Apr-24-2019, 09:07 AM
RE: semantic error log function - by buran - Apr-24-2019, 09:11 AM
RE: semantic error log function - by mcgrim - Apr-24-2019, 09:14 AM
RE: semantic error log function - by mcgrim - Apr-24-2019, 11:26 AM
RE: semantic error log function - by buran - Apr-24-2019, 11:35 AM
RE: semantic error log function - by mcgrim - Apr-24-2019, 11:39 AM
RE: semantic error log function - by buran - Apr-24-2019, 11:43 AM
RE: semantic error log function - by mcgrim - Apr-24-2019, 11:50 AM
RE: semantic error log function - by buran - Apr-24-2019, 06:34 PM
RE: semantic error log function - by mcgrim - Apr-24-2019, 07:53 PM
RE: semantic error log function - by buran - Apr-24-2019, 08:07 PM
RE: semantic error log function - by mcgrim - Apr-24-2019, 08:17 PM
RE: semantic error log function - by buran - Apr-24-2019, 08:36 PM
RE: semantic error log function - by mcgrim - Apr-24-2019, 08:43 PM
RE: semantic error log function - by buran - Apr-25-2019, 07:56 AM
RE: semantic error log function - by mcgrim - Apr-29-2019, 09:32 PM
invalid index to scalar variable - by mcgrim - Apr-24-2019, 08:22 AM

Forum Jump:

User Panel Messages

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