Files
freeCodeCamp/curriculum/challenges/italian/07-scientific-computing-with-python/python-for-everybody/objects-a-sample-class.md
Nicholas Carrigan (he/him) f25e3e69f8 feat: enable new langs (#42491)
Enable italian and portuguese
2021-06-15 13:19:18 +05:30

515 B

id, title, challengeType, videoId, dashedName
id title challengeType videoId dashedName
5e7b9f160b6c005b0e76f086 Objects: A Sample Class 11 FiABKEuaSJ8 objects-a-sample-class

--question--

--text--

What will the following program print?:

class PartyAnimal:
    x = 0
    def party(self):
        self.x = self.x + 2
        print(self.x)

an = PartyAnimal()
an.party()
an.party()

--answers--

So far 1
So far 2

0
0

2
2

2
4

--video-solution--

4