+ 4

what is a function time ??and how do work???

I want put time in my code and after this time print example hello please help me!

10th Dec 2018, 4:32 AM
Ali Mohammady
Ali Mohammady - avatar
3 Réponses
+ 7
To add delay sleep() is used. sleep() function is available in time library, So, first of all import the time library to your code by using >>>import time Then use the sleep() function from that library by >>>time.sleep(5) #sleep function takes seconds as a parameter, here it will delay the output for 5 seconds. Then you can put your actual code which is >>>print("Hello World") P.S. this will not work on Sololearn playground.
10th Dec 2018, 4:39 AM
Raj Chhatrala
Raj Chhatrala - avatar
+ 1
Look up the time module in the official python documentation Raj understood what you are looking for, time.sleep, but time is a very useful module, you should get familiar with the datetime module eventually too
11th Dec 2018, 3:30 PM
Genghis
Genghis - avatar
+ 1
Note: Sleeping a few seconds in total does actually happen--it's just not interactive :)
11th Dec 2018, 4:52 PM
Kirk Schafer
Kirk Schafer - avatar