Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
printing sideways
#1
I'm trying to print things out in a line but obviously missing something.
For the code

a = 5
print(f'{a} [');
for x in range(1, 11) :
    print(f'{x}, ')
print(']')
it prints

5 [
1, 
2, 
3, 
4, 
5, 
6, 
7, 
8, 
9, 
10, 
]
How do I get it to print like this

5 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
If this is already answered somewhere let me know. TIA
Reply


Messages In This Thread
printing sideways - by mnh001 - Sep-07-2019, 08:30 PM
RE: printing sideways - by ichabod801 - Sep-07-2019, 09:10 PM
RE: printing sideways - by mnh001 - Sep-07-2019, 09:18 PM

Forum Jump:

User Panel Messages

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