Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
times table
#1
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]
Reply
#2
If you're allowed to use an external library, I'd suggest 'prettytable' from pypi.
Reply
#3
(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 !
Reply
#4
pypi is python's 3rd party software repo
https://pypi.org/project/PrettyTable/
Recommended Tutorials:
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020