0

I tried this, but it just waited 10 seconds to print it all out at the same time

from time import sleep

print('This is a string. ', end='')
sleep(10)
print('This is another string')
rioV8
  • 24,506
  • 3
  • 32
  • 49

2 Answers2

-1

You can try print('This is a string.', end='', flush=True)
Else there is a solution using [ threading.Timer ( delay_time , function ) ] here to solve your problem

ThibautM
  • 1
  • 1
-1

You can take n as an input and store in a variable. and create a list of strings for simplicity.

from time import sleep

string1 = 'This is a string.'
string2 = 'This is another string'
arr = [string1,string2]
n = int(input())

for i in arr:
    print(i,end=' ')
    sleep(n)
Pomesh
  • 1
  • 1