on-internet
← Community

How to print a string with a little delay between the chars?

Stack Overflow ·

I want a text to be displayed as if it is just being typed. So I need a little delay after every letter. I tried to do it this way: import time text = "Hello, this is a test text to see if all works fine." for char in text: print char,time.sleep(0.2), It works fine, except for one problem. I get a "None" after every character. This is the output: H None e None l None l None o None , None None t None h None i None s None None i None s None None a None None t None e None s None t None None t None e None x None t None None t None o None None s None e None e None None i None f None None a None l N

Comments

Sign in or sign up to comment and upvote.

No comments yet.