[Tutor] Variables

Vishnu vishnu at acmet.com
Tue Feb 15 11:56:41 CET 2005


Hi,

Method-I:
=========

I1 = "John1" 
I2 = "John2" 
I3 = "John3" 

print "%s, %s and %s used to love pizza" % (I1,I2,I3)

Method-II:
=========
use dictionaries,

name["I1"] = "John1"
name["I2"] = "John2"
name["I3"] = "John3"

print "%{I1}s, %{I2}s and %{I3}s used to love pizza" % name


HTH,
Vishnu

-----Original Message-----
From: tutor-bounces at python.org [mailto:tutor-bounces at python.org] On Behalf Of ÀÌ Áø¼º
Sent: Tuesday, February 15, 2005 4:18 PM
To: tutor at python.org
Subject: [Tutor] Variables

How can I do it with several variables? 


I = "John" 
print "%s used to love pizza" % I 

About 10 or more... 

HELP plz :)

_________________________________________________________________
증권 정보 가장 빠르고 편하게 보실 수 있습니다. MSN 증권/투자   
http://www.msn.co.kr/stock/  

_______________________________________________
Tutor maillist  -  Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list