| | |
List Index Question
Thread Solved |
•
•
Join Date: Sep 2008
Posts: 78
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 |
address aliased anydbm app beginner bits calling casino changecolor cipher clear conversion coordinates corners count cturtle curves definedlines development dictionary dynamic events excel external feet file float format function generator getvalue handling homework iframe images import input ip java keycontrol line linux list lists loan loop maintain matching maze millimeter mouse number numbers output parsing path port prime programming py2exe pygame pymailer python queue random rational raw_input recursion recursive scrolledtext searchingfile signal singleton slicenotation split string strings tails text threading time tlapse tooltip tuple tutorial type ubuntu unicode url urllib urllib2 valueerror variable variables vigenere web whileloop word wxpython xlwt





