2020-04-06 14:49:56 -04:00
|
|
|
---
|
|
|
|
id: 5e7b9f160b6c005b0e76f086
|
2020-04-21 23:37:02 -05:00
|
|
|
title: 'Objects: A Sample Class'
|
2020-04-06 14:49:56 -04:00
|
|
|
challengeType: 11
|
2020-05-25 19:15:32 +05:30
|
|
|
isHidden: true
|
2020-04-06 14:49:56 -04:00
|
|
|
isRequired: true
|
|
|
|
videoId: FiABKEuaSJ8
|
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
|
|
|
<section id='description'>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
|
|
|
question:
|
2020-05-28 22:40:36 +09:00
|
|
|
text: 'What will the following program print?:
|
2020-04-06 14:49:56 -04:00
|
|
|
<pre>class PartyAnimal:<br> x = 0<br><br> def party(self) :<br> self.x = self.x + 2<br> print(self.x)<br>
|
|
|
|
<br>
|
|
|
|
an = PartyAnimal()<br>
|
|
|
|
an.party()<br>
|
|
|
|
an.party()</pre>'
|
|
|
|
answers:
|
|
|
|
- 'So far 1<br>So far 2'
|
|
|
|
- '0<br>0'
|
|
|
|
- '2<br>2'
|
|
|
|
- '1<br>2'
|
|
|
|
solution: 4
|
|
|
|
```
|
|
|
|
|
|
|
|
</section>
|