Week1

this is week 1

import getpass, sys

correct = 0

def questionAnswer(prompt):
    print("question: " + prompt)
    ans = input()
    print("Answer: " + ans)
    return ans

def questionRespone(prompt):
    print("question: " + prompt)
    ans = input()
    print("I got a number :",ans)
    return ans
    
def questi():
    global correct
    res = questionRespone("1 + 1 = ? ")
    if res == "2":
        print(res + " is correct")
        correct += 1
    else:
        print(res + " is incorrect")

    rep = questionRespone("2 + 3 = ? ")
    if rep == "5":
        print(rep + " is correct")
        correct += 1
    else:
        print(rep + " is incorrect")

    reg = questionRespone("3 + 5 = ? ")
    if reg == "8":
        print(reg + " is correct")
        correct += 1
    else:
        print(reg + " is incorrect")
    print((str)((float)(correct/quest*100)) + "%")

quest = 3


print('Hello, ' + getpass.getuser() + " running " + sys.executable)
print("You will be asked " + str(quest) + " questions.")
a = questionAnswer("Are you ready to take the test[y/n]? ")
if a == "y":
    questi()
else:
    print("......")

  
Hello, james running /bin/python3
You will be asked 3 questions.
question: Are you ready to take the test[y/n]? 
Answer: y
question: 1 + 1 = ? 
I goy number : 2
2 is correct
question: 2 + 3 = ? 
I goy number : 5
5 is correct
question: 3 + 5 = ? 
I goy number : 8
8 is correct
100.0%