Printing with delay | SoloLearn: Learn to code for FREE!

+1

Printing with delay

Is it possible to print somthing with delay in python or ruby.Like someone starts the script and after 10 seconds the massage will be displayed.is this possible and how can i do it?

4/25/2017 3:57:15 PM

Yoshyy

3 Answers

New Answer

+14

python: from time import sleep print('This is printed imediatelly.') sleep(10) # wait for 10 seconds print("This is printed 10 seconds later.")

+13

Note that this will not work in the code Playground. You will get: Time Limit Exceeded

+5

The first what I can explain to do a very long loop. From 0 to 10000000 for example. But I think there it is a easiest wey, special functions to set timeout.