Python Forum

Full Version: times table
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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]
If you're allowed to use an external library, I'd suggest 'prettytable' from pypi.
(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 !
pypi is python's 3rd party software repo
https://pypi.org/project/PrettyTable/