Search⌘ K
AI Features

Puzzle 1: Ready Player One

Explore the Ready Player One Python puzzle to test your ability to predict code output. This lesson helps you sharpen your coding logic and problem-solving skills through practical Python challenges.

We'll cover the following...

Guess the output

Try to guess the output of the code below:

Python 3.8
class Player:
# Number of players in the Game
count = 0
def __init__(self, name):
self.name = name
self.count += 1
p1 = Player('Parzival')
print(Player.count)

Quiz- Puzzle 1

1.

What is the expected output of the above code?

A.

0

B.

1

C.

The code throws a TypeError exception.

D.

The code throws an AttributeError exception.


1 / 1