08-13-2010, 10:50 AM
Hey, I added some thing to your program.
First, i moved the import os to the top. you should have all imports at the top of the script.
Next, I added a loop, so if somebody does not answer with 'male' or 'female' it askes again.
Finally, when asking about the number of pets, you have values for more and less than 5, but you do not have one for equal to 5, so I added one.
Nice beginning project
Code:
import os
print 'Welcome to your interview :)'
print 'You will be answered a series of questions through this examine.'
while True:
first = raw_input("\nPlease enter your gender: ")
if first == "male":
print "\nme too!"
break
elif first == "female":
print "\nthat's what she said :p"
break
else:
print "\nhey that's not a gender!"
second = int(raw_input("\nPlease enter the number of pets you own: "))
if second < 5:
print "\nYou aren't crazy! :p"
elif second > 5:
print "\nYou are borderline crazy, or crazy. :P"
elif second == 5:
print "\nThat's quite a lot!"
print "\nYou said you are a: "+first
print "\nYou said you have: "+str(second)+" pets"
os.system("PAUSE")
First, i moved the import os to the top. you should have all imports at the top of the script.
Next, I added a loop, so if somebody does not answer with 'male' or 'female' it askes again.
Finally, when asking about the number of pets, you have values for more and less than 5, but you do not have one for equal to 5, so I added one.
Nice beginning project
![Oui Oui](https://www.supportforums.net/images/smilies/oui.gif)
![[Image: idgjkO.png]](http://i.min.us/idgjkO.png)