Variables
Data Types
Conditionals
Loops
Lists
100

What will be printed? 

x = 10 

y = x 

x = 5 

print(y)

What is 10 ?

100

What is the data type of the result: 3 + 2.0?

float

100

What keyword is used when the if condition is false and we want to try another condition?

elif

100

What keyword is used to start a loop that repeats a fixed number of times?

for

100

What symbol is used to create a list in Python?

Square brackets []

200

What is the output of: 

x = 3 

x += 2 

print(x)

What is 5 ?

200

What will type([1, 2, 3]) return?

<class 'list' >

200

What keyword is used to catch all remaining cases after if and elif?

else

200

What keyword creates a loop that continues while a condition is true?

while

200

What is the index of the first item in a list?

0

300

What will be printed? 

x, y = 2, 3

x, y = y, x

print(x, y)

3,2

300

What is the output of int("5") + float("3.2")?

8.2

300

What is printed?
x = 10
if x > 10:
  print("Greater")
elif x == 10:
  print("Equal")
else:
  print("Smaller")

Equal

300

What does this print?


for i in range(3): 

     print(i)

1

2

300

What is the result of len([10, 20, 30, 40]) ?

4

400

If x = 10, 

what does x = x * 2 + 5 make x equal to? 

25

400

What will be the output of type("123") == type(123)?

 False


400

What is the output?
x = 7
if x % 2 == 0:
  print("Even")
elif x % 3 == 0:
  print("Divisible by 3")
else:
  print("Other")

Other

400

What is printed?
x = 5
while x > 0:
  x -= 1
  if x == 2:
    continue
  print(x)

4, 3, 1, 0

400

What is the output?


nums = [1, 2, 3]
for n in nums:
  print(n * 2)

2

4

6

500

What type of error will this produce? print(x) without assigning x first

NameError

500

What will be printed? 

x = None

print(type(x))

<class 'NoneType'>

500

What is the output?
x = -5
if x > 0:
  print("Positive")
elif x == 0:
  print("Zero")
elif x > -10:
  print("Small Negative")
else:
  print("Negative")

Small Negative

500

How many times would this get printed


for i in range(2):

   for j in range(3):

      print("*")


*

*

*

*

*

*

6 times


500

What is the output?


nums = [5, 8, 2, 9]
for n in nums:
  if n % 2 == 0:
    print(n)

8

2

M
e
n
u