Data Types
Operators and Operands
Conditionals
outputs
Strings
100

What data type is used to store whole numbers (e.g., 10, –3)?

int / integer

100

What is the output type of (int) 3.9?

nt (value becomes 3)

100

What keyword begins a conditional statement?

if

100

What data type stores multiple values of the same type?

Array

100

True or False: Strings are arrays of characters.

True

200

What data type stores true/false values?

boolean / bool

200

True or False: You can cast a string directly into a boolean.

False

200

What keyword runs only when the “if” condition is false?

else

200

What is the index of the first element in an array?

0

200

What is the length of the string "code"?

4

300

What data type stores single characters like ‘A’ or ‘#’?

char / character

300

What comparison operator means “equal to”?

==

300

What keyword allows you to check another condition after an if-statement?

else if / elif

300

for i in range(3):

    print(i*i)


0, 1, 4

300

What data type results from concatenating two strings?

String

400

Which data type stores decimal numbers with double precision?

double

400

What operator means “not equal to”?

!=

400

In if (x > 10), what must be true for the code to execute?

x must be greater than 10

400

Given the list [2, 7, 11, 15], find two numbers that sum to 9.

2 and 7

400

What is the index of the letter “g” in "program"?

Index 3 (0-based)

500

What data type is used for text?

string

500

What logical operator means AND?

&& or and

500

What is it called when you put an if-statement inside another if-statement?

Nested conditionals

500

What prints from this code?


if 5 > 3:

    print("Yes")


Yes

500

What prints?

x = 8

if x > 10:

    print("High")

elif x > 5:

    print("Medium")

else:

    print("Low")


Medium