Printing numbers from 1-100 as words in Python 3
<pre><code>List_of_numbers1to19 = ['one', 'two', 'three', 'four', 'five', 'six', 'seven',
                   'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen',
                   'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen',
                   'nineteen']
List_of_numbers1to9 = List_of_numbers1to19[0:9]
List_of_numberstens = ['twenty', 'thirty', 'fourty', 'fifty', 'sixty', 'seventy',
                       'eighty', 'ninety']

for i in List_of_numbers1to19:
    print(i)
list_of_numbers21to99 = []
count = 19
tens_count = 0
for j in List_of_numberstens:
    for k in List_of_numbers1to9:
        if tens_count%10 == 0:
            #should print an iteration of List_of_numberstens
            tens_count +=1
        tens_count +=1
        print(j, k)
</code></pre>

<p>As you can see, this is getting messy :P So sorry for that.
Basically I'm trying to print them using three different for-loops with a different index. I have tried slicing the list and indexing the list,  but I keep getting output for the numbers multipliable by 10 as the full list of <code>List_of_numberstens</code>. </p>

<p>I think it's clear what I'm trying to do here.</p>

<p>Thanks in advance for your help!</p>

<p>I think you're overcomplicating the 20-100 case. From 20-100, numbers are very regular. (i.e. they come in the form <code>&lt;tens_place&gt; &lt;ones_place&gt;</code>).</p>

<p>By using just one loop instead of nested loops makes the code simpler to follow. Now we just need to figure out what the tens place is, and what the ones place is.</p>

<p>The tens place can be easily found by using integer division by 10. (we subtract 2 since the list starts with twenty).</p>

<p>The ones place can similarly be found by using the modulo operator by 10.
(we subtract 1 since the list starts with 1 and not 0).</p>

<p>Finally we just take care of the case of the ones place being 0 separately by using an if statement (and just not print any ones place value).</p>

<pre><code>List_of_numbers1to19 = ['one', 'two', 'three', 'four', 'five', 'six', 'seven',
                        'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen',
                        'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen',
                        'nineteen']
List_of_numberstens = ['twenty', 'thirty', 'fourty', 'fifty', 'sixty', 'seventy',
                       'eighty', 'ninety']

for i in range(19):
  print(List_of_numbers1to19[i])

for i in range(20, 100):
  if i%10 == 0: #if multiple of ten only print tens place
    print(List_of_numberstens[i//10-2]) #20/10-2 = 0, 30/10-2 = 1, ...
  else: #if not, print tens and ones place
    print(List_of_numberstens[i//10-2] + ' ' + List_of_numbers1to19[i%10-1])
</code></pre>

python python-3.x numbers