Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 46 additions & 19 deletions quiz_game.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,67 @@
print("Welcome to my computer quiz!")
print('Wellcome to my Computer game! ')

playing = input("Do you want to play? ")

if playing.lower() != "yes":
playing = input('Do u Want to play!')
if playing != 'yes':
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a possibility that Yes, YES, yES etc is being typed into. So, .lower() is preferred by me. It's just a suggestion.

quit()

print("Okay! Let's play :)")
print("Ok Let's play : ) ")
score = 0

answer = input("What does CPU stand for? ")
if answer.lower() == "central processing unit":



print('''What Does CPU Stands for?
a)central processing unit.
b)graphics processing unit.
c)random access memory.
d)power supply
''')
answer = input('answer :')
if answer == 'a':
print('Correct!')
score += 1
else:
print("Incorrect!")
print('Incrrect!!!')

print('''What Does GPU Stands for?
a)central processing unit.
b)graphics processing unit.
c)random access memory.
d)power supply

answer = input("What does GPU stand for? ")
if answer.lower() == "graphics processing unit":
''')
answer = input('answer :')
if answer == 'b':
print('Correct!')
score += 1
else:
print("Incorrect!")
print('Incrrect!!!')

answer = input("What does RAM stand for? ")
if answer.lower() == "random access memory":
print('''What Does RAM Stands for?
a)central processing unit.
b)graphics processing unit.
c)random access memory.
d)power supply
''')
answer = input('answer :')
if answer == 'random access memory':
print('Correct!')
score += 1
else:
print("Incorrect!")
print('Incrrect!!!')

answer = input("What does PSU stand for? ")
if answer.lower() == "power supply":
print('''What Does PSU Stands for?
a)central processing unit.
b)graphics processing unit.
c)random access memory.
d)power supply
''')
answer = input('answer :')
if answer == 'd':
print('Correct!')
score += 1
else:
print("Incorrect!")
print('Incrrect!!!')

print("You got " + str(score) + " questions correct!")
print("You got " + str((score / 4) * 100) + "%.")
print('You got' + str(score) + 'questions correct!')
print('You got' + str((score/4) * 100) + '%.')