Beginner Codes/Python/Quiz Game
30%

Instructions

Syntax

if guess == answer: score += 1

Quiz Game Program 🏆

Namba lists, loops, if-statements ellam padichutom. Idha ellam vechu oru Quiz Game create panna porom!

1. Questions and Answers 📝

Mudhalla namba questions-um answers-um oru tuple-la store panni vechukalam. (Tuples na list madhiri dhaan, aana maatha mudiyadhu, so questions safe-a irukkum).

questions = ("What is 5 + 5?", "Color of the sky?")
answers = ("10", "Blue")
score = 0

2. Checking the Answer ✔️

Ippo user kitta input() vaangi, adhu correct-ana answer kooda match aagudha nu paakanum. Match aana, score-a 1 increase pannanum!

guess = input(questions[0])
if guess == answers[0]:
    print("Correct!")
    score += 1
else:
    print("Wrong!")

Interactive Quiz Logic 🎮

Kizhe ulla game-la answer select pannunga. Python eppadi if guess == answer: check panni score-a update pannudhu nu paarunga!

Quiz Game Logic

if guess == answer:
score += 1
else:
print("Wrong!")
guess
None
answer
"10"
score
0
Pick an answer from the options!

Question 1/2

Score: 0
What is 5 + 5?

Your Turn! (Unga neram!)

Oru chinna Quiz program kuduthurukkom.

  1. User oda guess-um nammoda answer-um same a nu if condition vechu check pannunga.
  2. Correct a irundha, score += 1 kodunga.

Help

Quiz GameExercise 24/7735 XP
❴❵ script.py
python.code
python
Loading...
Terminal
Terminal — python
Beginner Codes Terminal v1.0.0
─────────────────────────────────────
Ready. Click "Run Code" to execute...
Ready
Piston APIPYTHON0 lines