User Profile

Collapse

Profile Sidebar

Collapse
Edward Hobbs
Edward Hobbs
Last Activity: May 24 '12, 06:18 PM
Joined: Dec 16 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Edward Hobbs
    replied to IndexError: list index out of range
    Okay copy/paste messed up the indents, try #2:

    def findStudent(use rname):
    ____for i in range(1,len(stu dents)):
    ________if students[i][0] == username:
    ________return i
    ____return -1
    See more | Go to post
    Last edited by Edward Hobbs; Dec 16 '11, 09:14 PM. Reason: formatting still

    Leave a comment:


  • Edward Hobbs
    started a topic IndexError: list index out of range

    IndexError: list index out of range

    This is my first post, so please be patient with me.. So i've been coding in python for about a month, and i'm not exactly brilliant, so i'm stumped. The system is a basic login (A-Level work) for a "merit system", however the list cannot get past the first user in the class?

    Code:
    Code:
    def findStudent(username):
        for i in range(len(students)):
            if students[i][0] == username:
    ...
    See more | Go to post
    Last edited by bvdet; Dec 16 '11, 09:24 PM. Reason: Add code tags
No activity results to display
Show More
Working...