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.
2
Q
How is a class created?
A
class Monkey:
pass
3
Q
What is an instance?
A
An instance is an object in a class.
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.
5
Q
What is the ‘__init__’ function?
A
It is used to assign values to properties of an object in a class.
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