Differences between revisions 1 and 2
Revision 1 as of 2007-09-09 06:58:11
Size: 357
Editor: c-69-252-155-205
Comment:
Revision 2 as of 2007-09-09 07:00:49
Size: 407
Editor: c-69-252-155-205
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
x = 1
text = 1
Line 6: Line 8:

for x in range 10:
for x in range (10):
Line 10: Line 11:
I just need to do this to compare a history to make sure a number hasn't already been entered earlier. But this is just a small example I just need to do this to compare a history to make sure a number hasn't already been entered earlier. But this is just a small example. I get nasty errors.

Thanks!

How would I store information in variables that I can go back later and compare? Such as

x = 1 text = 1 while x != 10:

  • text[x] = int(raw_input("Enter a number: ")) x = x + 1

for x in range (10):

  • print text[x]

I just need to do this to compare a history to make sure a number hasn't already been entered earlier. But this is just a small example. I get nasty errors.

Thanks!

Asking for Help/How to store information in variable arrays? (last edited 2011-03-26 23:30:26 by PaulBoddie)

Unable to edit the page? See the FrontPage for instructions.