Files
freeCodeCamp/curriculum/challenges/english/07-scientific-computing-with-python/python-for-everybody/object-lifecycle.english.md
Oliver Eyton-Williams bd68b70f3d Feat: hide blocks not challenges (#39504)
* fix: remove isHidden flag from frontmatter

* fix: add isUpcomingChange

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

* feat: hide blocks not challenges

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
2020-09-03 15:07:40 -07:00

74 lines
1.1 KiB
Markdown

---
id: 5e7b9f170b6c005b0e76f087
title: Object Lifecycle
challengeType: 11
isRequired: true
videoId: p1r3h_AMMIM
---
## Description
<section id='description'>
</section>
## Tests
<section id='tests'>
```yml
question:
text: |
What will the following program print?:
```python
class PartyAnimal:
x = 0
name = ''
def __init__(self, nam):
self.name = nam
print(self.name,'constructed')
def party(self):
self.x = self.x + 1
print(self.name,'party count',self.x)
q = PartyAnimal('Quincy')
m = PartyAnimal('Miya')
q.party()
m.party()
q.party()
```
answers:
- |
Quincy constructed
Miya constructed
Quincy party count 1
Miya party count 2
Quincy party count 3
- |
Quincy constructed
Miya constructed
Quincy party count 1
Miya party count 1
Quincy party count 2
- |
Quincy constructed
Quincy party count 1
Quincy party count 2
Miya constructed
Miya party count 1
solution: 2
```
</section>