0

I Created a quiz game on python, where basically the user answers some questions i randomly made up and after that they press enter, it will say " calculating you smartness " and will show a random number on your screen. problem is,everytime the user press enter it will say "calculating your smartness" and shows the number at the same time. im wondering how to add a delay before starting the next code/line/script.?

here is my code so far

import os
import time
a = raw_input("how old is I?:")
w = raw_input("How many ants are in the world?:")
e = raw_input("why am i asking so many questions:")
s = raw_input("Are mcdonalds food healthier than pizza huts?:")
o = raw_input("Are you fat:")
m = raw_input("show me examples of random:")
e = raw_input("how to eat a chicken without a chicken?:")
e = raw_input("Can you park in reverse while driving forwards while flying?:")
os.system('cls')
print "----------------------"
print "here are your answers!"
print a
print w
print e
print s
print o
print m
print e
print e
print "----------------------------------------------------------"
print 'now calculating smartness:'
print "Your smart level is:"
import random
print random.randint(1,100)
print "----------------------------------------------------------"
print "aw c'mon you can do better than that!!!!"
print "----------------------------------------------------------"
raw_input("Press enter to quit the game")

please and thank you. :)

2
  • I think you shouldn't use e to store 3 of the answers, it will only store (and later display) the last one. Better use somehing like "abcdefgh" for your variables instead of "awesomee". Commented May 4, 2011 at 10:02
  • oh yeah, i didnt see that xD thanks for pointing that out! :) Commented May 4, 2011 at 10:06

3 Answers 3

2

time module's sleep()

Also, you already have it imported for some reason.

Sign up to request clarification or add additional context in comments.

1 Comment

lol thats because my friend and i where making random stuff with python i made this, i got into this problem, he helped me, but then i sorta pissed him off, so he deleted the code stuff i guess he forgot about that one? whatever that is :/
1

use time.sleep(secs), see here: http://docs.python.org/library/time.html#time.sleep

Comments

1

You're looking for time.sleep().

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.