Python 1
Python 2
Python 3
Python 4
Python 5
100

What file extension do python files have?

.py

100

Which variable type stores decimal numbers?

float

100

What is a collection of objects inside "[" and "]" called?

List

100

What is an attribute?

a variable declared inside a class

100

How do Python dictionaries retrieve values?

[key]

200

What does the function input() do, and what type of object does it return?

allows the user to type input. returns a string

200

What is the python function to get the length/size of a object?

len()
200

What is a collection of objects inside "(" and ")" called?

Tuple

200

new_obj = MyClass()

new_obj is an _____ of the class MyClass

instance

200

what is 129 in binary

10000001

300

To use modules in another Python script, you must first ______  the module.

import

300

What are these symbols called?

+,  ==,  - ,  / ,  // ,  *,  **, %

operators

300

What is indexing?

retrieving the element at a certain place in a sequence (list, tuple, string, etc.)

300

what keyword defines a function?

def

300

what is 87 in binary

01010111

400

To comment a line in python, which symbol do you use?

#

400

Which type of data would arise here?


a  = 5.888.4

SyntaxError

400

What is it called when you retrieve a contiguous subset of list elements, i.e. mylist[2:6]?

Slice

400

var = 7 

var >> 1

3

400

What are the two components of a dictionary data structure?

key and values

500

var = str(10)

var2 = str(19)

print(var+var2)

what's the result?

1019
500

What is the name you will set a variable equal to when you want it to have no value?

None

500

Explain immutability

It describes an object that cannot be changed once created

500

var = 10

var << 6

640

500

what do you need at the end of every if statement and loop?

a colon :

M
e
n
u