Python Forum
times table - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: times table (/thread-14940.html)



times table - aocii - Dec-25-2018

hi everyone, i know that my questions re too elementary but i am trying to learn. i am trying to write times table. so i wrote this code.
for i in range(1,11):
    for x in range(1,11):
        print( x , "x", i , "=" , i* x)
    print("-"*20)
but this code printout all list one under the other. i want to write first five column next to each other and the second five column are under of them. like this. appriciate in advance if anybody help me. thanks
i tried several attempt to write it but i couldnt. i suppose that it s not so complicated if it is, i dont want you to busy you too much so maybe you can give me some hint :)

[Image: carpimtablosu.png?revision=1537186717]


RE: times table - Gribouillis - Dec-25-2018

If you're allowed to use an external library, I'd suggest 'prettytable' from pypi.


RE: times table - aocii - Dec-26-2018

(Dec-25-2018, 11:07 PM)Gribouillis Wrote: If you're allowed to use an external library, I'd suggest 'prettytable' from pypi.

I did the code with my friend, but i didnt know the pypi. thanks !


RE: times table - metulburr - Dec-26-2018

pypi is python's 3rd party software repo
https://pypi.org/project/PrettyTable/