Back to marketplace

Basic Python

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

Are Python lists mutable (can they be changed after creation)?

Back (Answer)

Yes

#2
Front (Question)

Is everything in Python an Object?

Back (Answer)

Yes

#3
Front (Question)

Do Python Collection indexes start at 0?

Back (Answer)

Yes

#4
Front (Question)

Is Python case sensitive?

Back (Answer)

Yes

#5
Front (Question)

How do you do a 1 line comment in Python?

Back (Answer)

Use the ‘#’ symbol either at start of line, or inline

#6
Front (Question)

Can you have more than one statement on a line in Python?

Back (Answer)

Yes. Use the semi-colon to separate statements

#7
Front (Question)

What does dynamic typing mean?

Back (Answer)

Variable names can point to objects of any type e.g. x = 1 .. x is integer x = ‘hello’ … x is string x = [1, 2, 3] … x is list

#8
Front (Question)

In Python are variables containers or pointers?

Back (Answer)

Pointers e.g. x = 4, the variable x is a pointer that points to some other bucket containing 4

#9
Front (Question)

Give a comparison of a mutable type v an immutable type assignment

Back (Answer)

x = [1, 2, 3] #List a = 1 # int y = x # y is a List {1, 2, 3] b = a # b is an int 1 x.append(4) print(y) … y = [1, 2, 3, 4] # because Lists are mutable, variable y is still a pointer to the same bucket that x points to, and so y’s value is updated a = 2 print (b) … b = 1 # because ints are immutable, and so the assignment of a =2, forces a to become pointer to a new bucket. The previous bucket containing 1 cannot be updated, and so because b points there, the value of b still = 1

#10
Front (Question)

Is a Dictionary mutable?

Back (Answer)

Yes

#11
Front (Question)

Is a Set mutable?

Back (Answer)

Yes

#12
Front (Question)

Is a String mutable?

Back (Answer)

No, it is immutable

#13
Front (Question)

Is a Tuple mutable?

Back (Answer)

No, it is immutable e.g. t = (1, 2, 3) t[1] = 4 # not valid t.append(4) # not valid

#14
Front (Question)

Is an Int or Float mutable?

Back (Answer)

No, there are immutable

#15
Front (Question)

What are the standard Python Boolean operators?

Back (Answer)

and, or , not

#16
Front (Question)

What are identity operators?

Back (Answer)

is, is not … used to identify identical objects e.g. a = [1, 2, 3] b = [1, 2, 3] a == b # True a is b # False … a and b are not the same objects even though they contain the same value. a is b returns True if we do … a = [1, 2, 3] b = a

#17
Front (Question)

What are membership operators?

Back (Answer)

Membership operators check for membership within compound objects e.g. 1 in [1, 2, 3] #True 2 not in [1, 2, 3] # False

#18
Front (Question)

What is deep and shallow copying?

Back (Answer)

In Python assignment statements do not copy objects they create bindings between a target and an object. With mutable objects sometimes users want to create ‘real’ copies of the object, so that they can be changed without affecting the original. Deep Copying ( copy.deepcopy(object) ) … a copy of the object is copied to another object. Any changes made to the copy do not reflect in the original object. Slower than shallow copy. Shallow Copying ( copy.copy(object) ) … a copy of the object is made but it is populated with references to the child object, rather than actual copies. Shallow copying is also what happens when using factory functions e.g. new_list = list(orig_list).

#19
Front (Question)

What terminates a statement in Python?

Back (Answer)

The end of the line

#20
Front (Question)

How can you continue a statement over 2 lines in Python?

Back (Answer)

Use the ‘' marker or enclose statement within brackets e.g. x = (1 + 2 + 3 + 4 + 5 + 6 + 7 + 8) # this second type is recommended

#21
Front (Question)

What is indentation used for in Python?

Back (Answer)

To denote code blocks

#22
Front (Question)

What symbol is used to denote an indented code block?

Back (Answer)

A colon

#23
Front (Question)

How can you check the type of a Python object?

Back (Answer)

type(x)

#24
Front (Question)

What is exponential notation?

Back (Answer)

Where numbers are stored used the exponential format e.g. 5e-6, which equals 0.000005 or 1.4e6 which equals 1400000.00