Code Point
July 31, 2010, 10:49:17 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Geshi Sintax Hilighting Mod Installed. Tens of languages available.
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: How to program large numerical lists in python?  (Read 2260 times)
makai
Jr. Member
*

Karma: 0
Offline Offline

Posts: 1


« on: October 14, 2008, 06:45:04 AM »

Hello,
   I am new to Python and I am trying to program a simple, but long vector of numbers of the form [0 .1 .2 ...1000].  Rather than keying each entry, is there a simple way to assign a vector like this?  I honestly have not found an explanation yet (probably because its too simple maybe).  Any help would be really great.  Thanks so much.

Sincerely,
Makai 
Logged
Alter Lobo
Global Moderator
Jr. Member
*****

Karma: 10
Offline Offline

Posts: 65


« Reply #1 on: October 14, 2008, 12:44:10 PM »

I don't know if i understand what you mean by keying. This is how i would do it:

Code
l = list()
for i in range(0,1001):
  l.append(i)
print l
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!