Well, you have defined function get_questions() not to take any arguments, but in lines:
while current < len(get_questions(index)):
and
print current,". ",get_questions(current)
you're passing argument to it.
If you want your function to deal with arguments, you need to define it that way.
I would do something like this ( I reserve right to be completely wrong

):
[php]
true = 1
false = 0
def get_questions(x = -1):
lista = [["What colour is the daytime sky on a clear day?","blue"],\
["What is the answer to life, the universe and everything?","42"],\
["What is a three letter word for mouse trap?","cat"],\
["What noise does a truly advanced machine make?","ping"]]
if x == -1:
return lista
else: #of course, it's recommended to check if x is out of bounds
return lista[x]
menu_item = 0
while menu_item != 9:
print "------------------------------------"
print "1. Take test"
print "2. Display all questions and answers."
print "9. quit"
menu_item = input("Pick an item from the menu: ")
if menu_item == 1:
def check_question(question_and_answer):
question = question_and_answer[0]
answer = question_and_answer[1]
given_answer = raw_input(question) #what if user just press Enter?
if answer == given_answer:
print "Correct"
return true
else:
print "Incorrect, correct was: ",answer
return false
def run_test(questions):
if len(questions) == 0:
print "No questions were given."
return
index = 0
right = 0
while index < len(questions):
if check_question(questions[index]):
right = right + 1
index = index + 1
print "You got ", right*100/len(questions),"% right out of",len(questions)
run_test(get_questions())
elif menu_item == 2:
index = 0
length_quest = len(get_questions())
if length_quest > 0:
while index < length_quest:
print 'Question: ', get_questions(index)[0],
print 'Answer: ', get_questions(index)[1]
index = index + 1
else:
print "No questions"
print "Goodbye."
[/php]