-1

I'm trying to separate a long string into different words that I will print off with a .1 second delay on the same line.

Chris
  • 13
  • 4
  • look into [str.split](https://python-reference.readthedocs.io/en/latest/docs/str/split.html) – DSC Jun 22 '19 at 16:28
  • 1
    Welcome to StackOverflow. Please go through the "How to ask a good question" [link](https://stackoverflow.com/help/how-to-ask) in SO Help Center. Please describe what you have tried so far, what is not working, and what is the desired output. – UdonN00dle Jun 22 '19 at 16:29
  • 1
    String `split` and `time` module help you with this. What have you tried so far? – Austin Jun 22 '19 at 16:29

1 Answers1

0

You can split according to the space between them:

from time import sleep
string = "hello world"
words = string.split(' ') # splits the string into parts divided by ' '
for w in words:
    print(w, end=' ')
    sleep(0.1) #delays for 0.1 seconds
Vikhyat Agarwal
  • 1,723
  • 1
  • 11
  • 29