Classes Flashcards

1
Q

What is the correct syntax to create a class in Python?

A

def __init__(self, nums):
self.nums = nums

def someFunc(self):
x = self.nums
print(x)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the equivalent to this.variable in Python?

A

Self

How well did you know this?
1
Not at all
2
3
4
5
Perfectly