Python Flashcards

1
Q

What is a class?

A

A class is the blueprint of an object; it is a structure which contains attributes and behaviours.

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

How is a class created?

A

class Monkey:
pass

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

What is an instance?

A

An instance is an object in a class.

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

What is an instance method?

A

It is a method that defines the behaviour of an object in a class; it is specific to objects and not shared with other objects.

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

What is the ‘__init__’ function?

A

It is used to assign values to properties of an object in a class.

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

What is the order of importance for python operators?

A

Please Excuse My Dear Aunt Susie (PEMDAS):
Parenthesis
Exponential
Multiplication
Division
Addition
Subtraction

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