+ 1

How to draw a grid in python

8th Oct 2021, 8:26 AM
🌼Faith🌼
🌼Faith🌼 - avatar
8 Answers
+ 2
Nwachi Faith Do you mean something like a data frame? An example: https://code.sololearn.com/cxBcbws6Ll20/?ref=app
8th Oct 2021, 9:02 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
Thanks. But o actually wanted to print a grid like a graph sheet
8th Oct 2021, 10:06 AM
🌼Faith🌼
🌼Faith🌼 - avatar
10th Oct 2021, 7:40 AM
Prabhas Koya
0
Nwachi Faith Something like this perhaps: height = int(input()) width = int(input()) print(("_"*3+" ")*width) for i in range(height): print((" "*3+"|")*width) print(("_"*3+"|")*width)
8th Oct 2021, 10:25 AM
Rik Wittkopp
Rik Wittkopp - avatar
0
You could look at tabulate module. It has several grid designs which you can use very easily. https://pypi.org/project/tabulate/
9th Oct 2021, 12:54 AM
🌀 Shail Murtaza شعیل مرتضیٰ
🌀 Shail Murtaza شعیل مرتضیٰ - avatar