def addTwoNumbers(operand1,operand2):
return operand1+operand2
print "Nothing happenning here"
def addTwoNumbers(num1,num2):
return num1+num2
def subtractTwoNumber(num1,num2):
return num1-num2
print "Nothing happenning here"
def addTwoNumbers(operand1,operand2):
return operand1+operand2
iResult= addTwoNumbers(5,5)
def addTwoNumbers(operand1,operand2):
return operand1+operand2
print "The result is : ",addTwoNumbers(5,5)
def addTwoNumbers(operand1,operand2):
return operand1+operand2
num1=int(raw_input("Enter the first number: "))
num2=int(raw_input("Enter the second number: "))
print "The result is: ",addTwoNumbers(num1,num2)
def printReportHeader():
print "\n Column1 \t Column2 \t Column3 \t Column4 \n"
printReportHeader()
num1=int(raw_input("Enter a number: "))
print "You entered ",num1
def getSecondNumber():
num1=int(raw_input("Enter Second number: "))
return num1
num1=int(raw_input("Enter a number: "))
num2=getSecondNumber()
print "you entered "+str(num1)+" and ",str(num2)
iLuckyNumber=int()
def printLuckyNumber():
print "Your lucky number is: ",iLuckyNumber
iLuckyNumber=int(raw_input("Enter your lucky number: "))
printLuckyNumber()
import os
import time
def sportsQuestion():
print "Sports Question"
print "What University did NFL star Deon Sanders attend?"
print "1 \t University of Miami"
print "2 \t California State University"
print "3 \t Indiana University"
print "4 \t Florida State University"
iAnswer=int(raw_input("Enter your selection :"))
return iAnswer
def geographyQuestion():
print "Geography Question"
print "What is the state capitol of Florida?"
print "1 \t Pensecola"
print "2 \t Tallahassee"
print "3 \t Jacksonville"
print "4 \t Miami"
iAnswer=int(raw_input("Enter your selection :"))
return iAnswer
def pause(inNum):
iCurrentTime=0
iElapsedTime=0
iCurrentTime=int(round(time.time()*1000))
while((iElapsedTime-iCurrentTime)<inNum):
iElapsedTime=int(round(time.time()*1000))
giResponse=0
while(giResponse !=3):
os.system('cls')
print "\n\tTHE TRIVIA GAME\n\n"
print "1\tSports\n"
print "2\tGeography\n"
print "3\tQuit\n"
giResponse=int(raw_input("Enter your Selection: "))
if(giResponse==1):
if(sportsQuestion()==4):
print "\nCorrect\n"
else:
print "\nIncorrect\n"
pause(2)
break
elif(giResponse==2):
if(geographyQuestion()==2):
print "\nCorrect\n"
else:
print "\nIncorrect\n"
pause(2)
break