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 know you already accepted an answer, but you particularly mentioned nested loops - which it doesn't use - and you're missing what's great about Python's iteration and not needing to do that kind of <code>i//10-2</code> and <code>print(j,k)</code> stuff to work out indexes into lists. </p>

<p>Python's <code>for</code> loop iteration runs over the items in the list directly and you can just print them, so I answer:</p>

<pre><code>digits = ['one', 'two',   'three', 'four', 'five', 
          'six', 'seven', 'eight', 'nine']

teens  = ['ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 
          'sixteen', 'seventeen', 'eighteen', 'nineteen']

tens   = ['twenty', 'thirty', 'fourty', 'fifty', 
          'sixty', 'seventy', 'eighty', 'ninety']

for word in digits + teens:
    print(word)

for tens_word in tens:
    print(tens_word)        # e.g. twenty

    for digits_word in digits:
        print(tens_word, digits_word)   # e.g. twenty one

print("one hundred")
</code></pre>

<p><a href="https://repl.it/D80Y">Try it online at repl.it</a></p>

python python-3.x numbers