Python Forum
code with no tuple gets : IndexError: tuple index out of range
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
code with no tuple gets : IndexError: tuple index out of range
#1
Hello! I'm in the works of a flask app which I already had issues with and some nice ppl helped me, and am having other issues...

I have this if statement:
if not ((lines[4] == lines[6] == dataseg[0]) & (lines[5] == dataseg[1])):
and I get this error:
Error:
if not ((lines[5] == lines[7] == dataseg[0]) & (lines[6] == dataseg[1])): IndexError: tuple index out of range
The full error being:
Error:
2020-11-03 17:09:58,492] ERROR in app: Exception on /send [POST] Traceback (most recent call last): File "/home/aggam/.local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/home/aggam/.local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/aggam/.local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/aggam/.local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/home/aggam/.local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/home/aggam/.local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "app.py", line 70, in send return render_template("code.html", ERRS=check.check(code)) File "app.py", line 53, in check if not ((lines[5] == lines[7] == dataseg[0]) & (lines[6] == dataseg[1])): IndexError: tuple index out of range
Can u guys help me? (sry my code is a mess LMAO)

My code: https://pastebin.com/ukMv4nTy
Reply


Messages In This Thread
code with no tuple gets : IndexError: tuple index out of range - by Aggam - Nov-03-2020, 03:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  using > < for tuple , list,... akbarza 3 487 Feb-05-2024, 01:18 PM
Last Post: deanhystad
Sad UnpicklingError: NEWOBJ expected an arg tuple. biyazelnut 0 464 Dec-20-2023, 03:16 AM
Last Post: biyazelnut
  Searche each element of each tuple based 3 numbes zinho 8 888 Dec-11-2023, 05:14 PM
Last Post: zinho
  tuple indices must be integers or slices, not str cybertooth 16 11,593 Nov-02-2023, 01:20 PM
Last Post: brewer32
Question mypy unable to analyse types of tuple elements in a list comprehension tomciodev 1 484 Oct-17-2023, 09:46 AM
Last Post: tomciodev
  IndexError: index 10 is out of bounds for axis 0 with size 10 Mehboob 11 2,117 Sep-14-2023, 06:54 AM
Last Post: Mehboob
  Change font in a list or tuple apffal 4 2,699 Jun-16-2023, 02:55 AM
Last Post: schriftartenio
Thumbs Down I hate "List index out of range" Melen 20 3,347 May-14-2023, 06:43 AM
Last Post: deanhystad
  search in dict inside tuple steg 1 711 Mar-29-2023, 01:15 PM
Last Post: rob101
Exclamation IndexError: Replacement index 2 out of range for positional args tuple - help? MrKnd94 2 6,399 Oct-14-2022, 09:57 PM
Last Post: MrKnd94

Forum Jump:

User Panel Messages

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