-1

is there a function in python that delays a program from running for n number of seconds? I am trying to achieve something like this:

print("Hello")
delay(5) #delays the program by 5 seconds
print("World!")

Any help will be greatly appreciated, Thank you!

Brian
  • 1
  • 1

1 Answers1

4

Sure!

import time

print("Hello")
time.sleep(5) #delays the program by 5 seconds
print("World!")
Kalma
  • 111
  • 2
  • 15