Results 1 to 1 of 1

Thread: Python list incorrect syntax, but why?

  1. #1
    Join Date
    Jun 2008
    Location
    Malaysia
    Beans
    652
    Distro
    Ubuntu 16.04 Xenial Xerus

    Question Python list incorrect syntax, but why?

    Hello there, ok straight to the point.
    I'm using Python IDLE 3.1 in Ubuntu 10.04 Beta 2.

    This is the part of the code that python complains about:
    Code:
    # add a score
    elif choice == "2":
        score = int(input("What score did you get?: ")
        scores.append(score)
    It says "scores.append(score)" is incorrect syntax. Why is this so?
    I'm learning from a book titled 'Python Programming Third Edition for absolute beginners'. I initiated the scores list as follows:
    Code:
    scores[]
    Thanks if anyone can assist me with this !

    EDIT: I apologize, after going through it several times I realized it was missing an extra end brace for the input section.
    Last edited by myromance123; April 24th, 2010 at 09:29 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •