| | |
List Index Question
Thread Solved
![]() |
•
•
Join Date: Sep 2008
Posts: 76
Reputation:
Solved Threads: 1
First off, I know that to set an indexed variable, say, mylist[3] = "Hello". I also know that you wouldn't be able to set mylist[3] if you didn't first state:
[code = python]mylist = ["Whatever", "Whatever", "Whatever", "Whatever"][/code]
But, if you had a variable with an extremely large index, it would be a pain in the rear to type " "Whatever", " that many times.
So, my question is, is there a not-tedious way to do this? Like Ruby's mylist = "Whatever" * 100?
Thanks in advance.
[code = python]mylist = ["Whatever", "Whatever", "Whatever", "Whatever"][/code]
But, if you had a variable with an extremely large index, it would be a pain in the rear to type " "Whatever", " that many times.
So, my question is, is there a not-tedious way to do this? Like Ruby's mylist = "Whatever" * 100?
Thanks in advance.
![]() |
Similar Threads
- Multiple Select List Handling (JSP)
- function style cast question (C++)
- can't seem to make a yes/no question (C)
- Non-programmer tutorial, stuck at list exercise (Python)
- JTextArea question (Java)
- Question about binary tree & heaps (Computer Science)
- Question: Where are good Assembly Compilers? (Assembly)
- another merge sort question (C++)
Other Threads in the Python Forum
- Previous Thread: Jython question
- Next Thread: SOAP Web Services with WSDL
| Thread Tools | Search this Thread |
abrupt accessdenied ansi anti apache application approximation argv array assignment backend beginner binary bluetooth builtin calculator change character converter countpasswordentry curved customdialog dan08 dictionary edit exe file float format function gnu heads homework ideas inches input java keyboard lapse leftmouse library line lines linux list lists loop microphone mouse movingimageswithpygame mysqlquery newb number numbers numeric output parameters parsing path phonebook pointer prime programming py2exe pygame pyopengl python random recursion redirect remote reverse scrolledtext session software sprite sqlite statictext statistics string strings syntax terminal text thread threading time tlapse tuple twoup ubuntu unicode unit urllib urllib2 variable wordgame write wxpython xlib





