strings
data types
lists
loops
logic
100

What will this code print? 

print("Hello\nWorld")

Hello

World

100

What symbol is used in Python to assign a value to a variable?

Equal sign = 

Called an "assignment operator"

100

What is a list in Python?

A collection of items stored in one variable

100

This type of loop repeats a set of instructions for each item in a list

What is a for loop

100

This statement checks a condition and executes a block of code only if the condition evaluates to True.

What is an if statement

200

How do you add a tab space in a Python string?

Use \t inside the string

200

What data type would the value 42 be in Python?

Integer

whole number - positive or negative

200

What index does Python start counting from in a list?

what is 0

200

In the below loop, what is magician?

 for magician in magicians:

A variable that stores each item of the list one at a time

200

Which operator is used to check if two values are equal?

What is ==

300

What does the print() function do?

Shows text or values on the screen

300

The number 3.14 would be what dat type?

float

decimal number

300

Which method adds a new item to the end of a list?

What is append()

300

In Python, this formatting is required to show which lines of code belong to a loop, function, or conditional block.

What is indention

300

Which keyword should you use when there are more than two choices in your logic?

What is elif


Stands for:  else if

400

What does the \n character do in a string?

Moves text to a new line

400

Which is a valid variable name?
student_age
2students
student-age
student age

student_age

2students- can't start with a number

stundent-age - dashes are a no

student age - cannot have spaces

400

In a list, to store several items together and access them by index, you enclose them in this kind of brackets, separated by what?.

Use square brackets [ ] with items separated by commas

400

What will this code print?

magicians = ['alice', 'david']
for magician in magicians:
     print(magician)
print("Done")

alice, david, then Done

400

Which logical operator requires all conditions to be True?

What is and

500

What is the name of the string formatting method that allows you to embed variables directly inside a string using curly braces {}

What is f-string

500

Which method turns text uppercase?


.upper()

500

Which function shows a sorted version of a list without changing the original?

What is sorted()

500

How do you access the last item of a list?


What is list[-1]

500

Since the input() function always returns a string, you must do this to the data before performing math operations.

What is convert