Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
24 Cards in this Set
- Front
- Back
What is a class? |
A special data type which defines how to build a certain kind of object |
|
What are instances? |
Objects that are created which follow the definition given inside the class |
|
What does __init__ do? |
Serves as a constructor for the class that does the initialisation work |
|
What special first argument is defined inn all of method definitions? |
self |
|
What type of arguments can be defined in functions or methods? |
Default values |
|
What is Python? |
An interpreted language |
|
Are variables objects in Python? |
All variables are objects in Python |
|
What is data type in Python? |
A property of the object and not of the variable |
|
What type of numbers does Python have? |
1) Integers 2) Floating point numbers 3) Long integers 4) Complex numbers |
|
What is the difference between int(x) and float(x)? |
int(2.0) = 2 float(2) = 2.0 |
|
What are strings in Python? |
Immutable |
|
What does immutable mean? |
Means they cannot be altered or changed |
|
What does str(Object) do? |
Returns a string representation of the object |
|
What type are lists? |
Mutable |
|
What are lists? |
Ordered collection of data |
|
What are tuples in Python? |
Immutable versions of lists |
|
What are dictionaries? |
A set of key-value pairs that are mutable |
|
How to delete an element in dictionary? |
del(d[2]) |
|
What two types of false values can you have in Python? |
0 and None |
|
What values can you have that equates to true in Python? |
Everything except 0 and None |
|
What type are functions? |
Objects |
|
What are default parameters? |
The ability to set a default value unless they are overriden by a given parameter |
|
What are named parameters? |
To name a parameter |
|
What are modules in Python? |
1) Highest level structure 2) .py files 3) Has own namespace |