Back to marketplace

Wk 2: Background in Python and Unix

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

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

Card preview (20)

#1
Front (Question)

Python tool for debugging online

Back (Answer)

pythontutor.com

#2
Front (Question)

What is dynamic typing of variables?

Back (Answer)

you don’t have to declare type of variable

#3
Front (Question)

Why does python allow for dynamic typing?

Back (Answer)

Everything in python is an object

#4
Front (Question)

What happens when you assign a different type to a variable that’s already been created?

Back (Answer)

Python creates a new object, and then points your variable at the new one (garbage collector takes care of original)

#5
Front (Question)

IS operator

Back (Answer)

tests if two variables point to the same object

#6
Front (Question)

assign a value to a variable

Back (Answer)

X = 5, X = “hello”, X = 4.5

#7
Front (Question)

Some string methods in python

Back (Answer)

capitalize(), lower() – return copies of the original (but don’t modify the original)

#8
Front (Question)

How to call lower() method on variable x?

Back (Answer)

x.lower()

#9
Front (Question)

How to assign output of x.lower to x?

Back (Answer)

x = x.lower()

#10
Front (Question)

Loop syntax example in python

Back (Answer)

for i in range (0,10): print (i)

#11
Front (Question)

Range(x,y) - x is inclusive? y is inclusive?

Back (Answer)

x is inclusive, y is exclusive

#12
Front (Question)

loop syntax increment by 2

Back (Answer)

for i in range (0,10,2): print (i)

#13
Front (Question)

while loop equivalent of “for i in range (0,10,2)”

Back (Answer)

i = 0; while i < 12: print(i); i+=3

#14
Front (Question)

Print var1 if var1 == 2

Back (Answer)

if var1 == 2: print(var1)

#15
Front (Question)

If / else if / else syntax

Back (Answer)

if x==2; elif x==3: else:

#16
Front (Question)

define a function

Back (Answer)

def func_name(args): xxxx; return val

#17
Front (Question)

what’s the downside of not having to define the type of the args or the return value

Back (Answer)

will get the error at run time if a value is passed that isn’t the expected type

#18
Front (Question)

what does a function return if there is not return statement

Back (Answer)

returns None

#19
Front (Question)

What’s the scope of a variable set at the top of the code

Back (Answer)

Global - it’s available throughout all code, and the functions

#20
Front (Question)

What’s the scope of a variable set inside of a function

Back (Answer)

only available in that function, unless it has the same name as a prev set global var