0

My current program uses the average definitions and prints and inputs; however, how do I use the time library? Do I have to import time? My program includes a lot of print statements in one particular definition; therefore, I want to add a pause of like 2 seconds each to separate every other print statements as it currently looks too automatic, so how would I go about doing this? Also, do I have to continue writing import timeevery time I want to use it? (so every couple print statements)

Many thanks!!

Lebby
  • 9
  • 5
  • Would I add them on separate lines, do I need to keep writing import time each time I want to use it, and lastly, do I need to add a colon after 'import time'? @DeliriousSyntax – Lebby Dec 15 '15 at 22:21
  • Yes `import time` and use `time.sleep` and pass a pause value in seconds. – Paul Rooney Dec 15 '15 at 22:21
  • So sorry that I accidentally deleted your comment - Please could you re add it as it was a fault on my half. @DeliriousSyntax – Lebby Dec 15 '15 at 22:22
  • @PaulRooney Would I need to add the line 'import time' every time that I want to use it (every 3 print statements) and do I need a colon after 'import time'? – Lebby Dec 15 '15 at 22:25
  • no just once per file. You only need a semi-colon if you have 2 statements on the same line. – Paul Rooney Dec 15 '15 at 22:27
  • Thank you sooo much for the help! It was very much appreciated! @PaulRooney – Lebby Dec 15 '15 at 22:31

0 Answers0