ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-tutor
python-tutor
[Tutor] SyntaxError while defining tuple : Guidance requested
by John Joseph other posts by this author
Dec 31 2005 12:10AM messages near this date
Re: [Tutor] Numeric RandomArray seed problem. | Re: [Tutor] SyntaxError while defining tuple : Guidance requested
Hi 
   I am trying out learning python , using the book
Â?Python Programming for the absolute beginner Â? by
Michael Dawson 
               I  get 
 File "page114.py", line 12
    inventory = ("Sword","Armor","Shield","Healing
Potion")
            ^
SyntaxError: invalid syntax

when I run the program which I copied from the text ,
tried a lot to find the reason , I thought of sending
it to the list , so that I get feed back on where I
had gone worng 

**********************************************************
inventory()

# treat the tuple as condition

if not inventory:
        print "U are empty Handed."

raw_input("\nPress the enter key to continue."

#Create a tuple with some items

inventory = ("Sword","Armor","Shield","Healing
Potion")

#print the tuple

print "\n The Tuple inventory is: \n", inventory


# print each element in the tuple

print "\nYour Items:"
for item in inventory:
        print item,



		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre.
 http://uk.security.yahoo.com
_______________________________________________
Tutor maillist  -  Tutor@[...].org
http://mail.python.org/mailman/listinfo/tutor
Thread:
John Joseph
Brian van den Broek
Alan Gauld
John Joseph

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved