python print one line same space

前端 未结 4 2072
悲&欢浪女
悲&欢浪女 2021-01-26 14:06

I need to print \'ok\' in same place. Any ways to do it?

I\'ve found solutions but they don\'t works with IDLE correctly:

 while (count < 9):
      if         


        
4条回答
  •  抹茶落季
    2021-01-26 14:32

    If you need to print them one at a time, use one of the other answers. This will print them all at once:

    my_var = ''
    while (count < 9):
          if statusm == "OK":
             my_var += 'ok'
    print my_var
    

提交回复
热议问题