Is there a way to make my text start from a certain point?
Question:
So I want to make something like that will print like this
100|
..50|
….0|
(the dots are there bc I couldnt make it appear in here without it)
ive been thinking of using a for loop to check how many spaces it should have, but I’m just wondering if there is anything else that is more efficient
Answers:
Try to use format() For example, the following script print from 0 to 100, align to right(>), and the space is 10 digits(10d)
for t in range(0,101,10):
print("{:>10d}".format(t))
So I want to make something like that will print like this
100|
..50|
….0|
(the dots are there bc I couldnt make it appear in here without it)
ive been thinking of using a for loop to check how many spaces it should have, but I’m just wondering if there is anything else that is more efficient
Try to use format() For example, the following script print from 0 to 100, align to right(>), and the space is 10 digits(10d)
for t in range(0,101,10):
print("{:>10d}".format(t))