Python word length
<p>Is there a way that I can set only some variables.</p>

<pre><code>l1, l2, l3, l4, l5, l6, l7, l8, l9, = (' ',)*9
word = input("Choose up to a 9 letter word: ")
wordlist = list(word)
wordl = len(word)
l1, l2, l3, l4, l5, l6, l7, l8, l9, = (wordlist)
</code></pre>

<p>More specifically is there a way that if someone enters a 6 letter word that it will only set up l6 and leave l7-l9 blank? </p>

<p>I really don't understand what you are trying to do, but if you want to assign values to <code>l1</code>, <code>l2</code>... <code>l9</code> based on the suffix(number) where the suffix corresponds to the length word then here's the code:</p>

<pre><code>&gt;&gt;&gt; l1, l2, l3, l4, l5, l6, l7, l8, l9, = (' ',)*9
... word = input("Choose up to a 9 letter word: ")
... locals().update({'l'+str(len(w)): w for w in word.split() if len(w)&lt;10})
... l1, l2, l3, l4, l5, l6, l7, l8, l9,
Choose up to a 9 letter word: idoKtknow waht you trying ti do ?
10: ('?', 'do', 'you', 'waht', ' ', 'trying', ' ', ' ', 'idoKtknow')
</code></pre>

python python-3.x