Code Point
July 31, 2010, 10:58:41 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Geshi Sintax Hilighting Mod Installed. Tens of languages available.
Home
Help
Search
Login
Register
Code Point
>
Client Side
>
Python
(Moderator:
Alter Lobo
) >
How to program large numerical lists in python?
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: How to program large numerical lists in python? (Read 2261 times)
makai
Jr. Member
Karma: 0
Offline
Posts: 1
How to program large numerical lists in python?
«
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
Posts: 65
Re: How to program large numerical lists in python?
«
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
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Announcements
-----------------------------
=> Announcements
-----------------------------
Client Side
-----------------------------
=> Python
-----------------------------
Server Side
-----------------------------
=> Web Python
=> PHP
-----------------------------
Test
-----------------------------
=> Test
Loading...