Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

quiz game in python

import turtle
q1 = input("Do you wanted to play our game Y/N?
--->")
q1= q1.lower()
if q1== "y":
          print("ok then let's start")
          a=input("What does cpu stands for?
-->")
          a=a.lower()
          if a=="central processing unit":
                    print("the answer "+a+" is correct! So congratulations")
          else:
                    print("the answer "+a+" is incorrect")
          b=input("What does ALU stands for?
-->")
          b=b.lower()
          if b=="arthemetical logic unit":
                    print("the answer "+b+" is correct! So congratulations")
          else:
                    print("the answer "+b+" is incorrect")
          c=input("What does cu stands for?
-->")
          c=c.lower()
          if c=="control unit":
                    print("the answer "+c+" is correct! So congratulations")
          else:
                    print("the answer "+c+" is incorrect")
          d=input("What does SSD stands for?
-->")
          d=d.lower()
          if d=="solid state disk":
                    print("the answer "+d+" is correct! So congratulations")
          else:
                    print("the answer "+d+" is incorrect")
          e=input("What does MU stands for?
-->")
          e=e.lower()
          if e=="memory unit":
                    print("the answer "+e+" is correct! So congratulations")
          else:
                    print("the answer "+e+" is incorrect")
else:
          print("ok then next time")
          quit
 
PREVIOUS NEXT
Tagged: #quiz #game #python
ADD COMMENT
Topic
Name
9+8 =