Easyguiie

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

import easygui

name = easygui.enterbox("What's your name??")

score = 0

Q1 = easygui.ynbox("4+5+6+1+2*0 = 0")
if Q1 == False:
score = score + 1

Q2 = easygui.ynbox("Is chocolate brown?")


if Q2 == True:
score = score + 1

Q3 = easygui.ynbox("12*12 = 144")
if Q3 == True:
score = score + 1

Q4 = easygui.enterbox("Is hot coffee is hot?")


if Q4 == "yes":
score = score + 1
elif Q4 == "hot":
score = score + 1

q5 = easygui.enterbox("How many oranges I have if I have 10 of


them?")
if q5 == "10":
score = score + 1

q6 = easygui.enterbox("What is IDE stand for")


if q6 == "Integrated Development Environment":
score = score + 1

#mcq1
msg1 = "What is the taste of candy?"
title1 = "Question7 MultipleChoice1"
choices = ["sweet", "sour", "spicy", "bitter"]
q7 = easygui.choicebox(msg1, title1, choices)
if q7 == "sweet":
score = score + 1
#mcq2
msg2 = "What is the of lime?"
title2 = "Question8 MultipleChoice2"
q8 = easygui.choicebox(msg2, title2, choices)
if q8 == "sour":
score = score + 1
#mcq3
msg3 = "What is the taste of chilly?"
title3 = "Question9 MultipleChoice3"
q9 = easygui.choicebox(msg3, title3, choices)
if q9 == "spicy":
score = score + 1
#mcq4
msg4 ="What is the taste of citrus fruit?"
title4 = "Question10 MultipleChoice4"
q10 = easygui.choicebox(msg4, title4, choices)
if q10 == "sour":
score = score + 1

percentage = str(int(score/10 * 100)) + "%"

if score >=9:
g = "A"
elif score >=8.5 and score < 9:
g = "B+"
elif score >=8 and score < 8.5:
g = "B"
elif score >=7.5 and score < 8.5:
g = "C+"
elif score >=7 and score < 7.5:
g = "C"
elif score >=6.5 and score < 7:
g = "D+"
elif score >=6 and score < 6.5:
g = "D"
else:
g = "F"

easygui.msgbox("You got" + percentage + " = " + str(g))

You might also like