why print (list_name) without quots

This is the place for queries that don't fit in any of the other categories.

why print (list_name) without quots

Postby ihelios9@gmail.com » Sat Jun 08, 2013 5:44 pm

i created 2 lists of games and foods. and joint them than print it successfuly by typing--
print (favourites)
without using quots ' ' unlike print ('hello world') why i can print list_name without using quots ' '
this is my first day of python learning. :)
:roll:
ihelios9@gmail.com
 
Posts: 2
Joined: Sat Jun 08, 2013 5:23 pm

Re: why print (list_name) without quots

Postby Yoriz » Sat Jun 08, 2013 7:02 pm

Whatever is between "" is a string it literally prints whats between them, if you put "" around favourites it would actually print the string favourites, when you print favourites with no "" as it is a variable pointing to an object it prints the string value of that object.
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 871
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: why print (list_name) without quots

Postby ihelios9@gmail.com » Sun Jun 09, 2013 5:31 am

Thankyou. now i understand it.
ihelios9@gmail.com
 
Posts: 2
Joined: Sat Jun 08, 2013 5:23 pm


Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot] and 2 guests