CDAT - Computer Science‎ > ‎2015-16‎ > ‎PAG&S‎ > ‎News and Assignments‎ > ‎

6 OCT

posted Oct 6, 2015, 5:01 AM by Tom Culpepper   [ updated Oct 6, 2015, 9:43 AM ]
intro to programming: we'll learn how to use functions to make code more efficient.



We'll use the code below for later...

def askQuestion (question, answer):
    #your code goes here
    
askQuestion("What is the capitol of France?", "Paris")
askQuestion("What is 9 + 10?", "19")
askQuestion("What is 5 to the zero power?", "1")


""" Here's what we'll do with this...
1)  add code to the askQuestion function. It should
say print the question to the screen and check if
the user put in the right answer.  If they got it 
right it should say 'good job' if they got it wrong
it should tell them 'no, that's wrong.'


2) add scoring."""
Comments