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>You don't need to do any of that. If you want to fill unused characters with a space, you can use <code>str.ljust</code> or string formatting.</p>

<pre><code>&gt;&gt;&gt; 'word'.ljust(9)
'word     '
&gt;&gt;&gt; '{:&lt;9}'.format('word')
'word     '
</code></pre>

python python-3.x