chris Hynes wrote:
I guess I have to start somewhere to ask............

I want the user to input a name, say "Chris". I know I can use the code:

name=raw_input()

I now want:

"Chris"=zeros((3,3))

This is a FAQ. In Python one is discouraged from dynamically creating variable names. Preferred is a dictionary.

names = {} # empty dictionary
name=raw_input()
names[name]=zeroes((3,3))
print names["Chris"]

--
Bob Gailer
Chapel Hill NC
919-636-4239
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to