I want to run a true while loop in first line of output with end=' ' just like this print(' ',end=' ') # this will print ' ' in first line of output for ever
and so I want to run this as same as previous line but at second line of my output
like this
// this will run and show at first line
while True :
print('*',end=' ')
// this will run and show at second line
while True :
print('$',end=' ')
*****************************...
$$$$$$$$$$$$$$$$$$$$$$$...
for instance
write a program that " print '*' every 3s in first line of output and print '$' every 5s in second line of output " (at the same time)
How can i do this?
use ``` to mark the beginning/end of your code snippets so it's actually readable.
As the comments mentioned, use \n
for a new line anywhere. Omitting the end='' parameter will put a new line by default. Otherwise you can just do an empty print()
to insert a newline character between your two loops, which does the same as print("\n", end='')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.