Loops
Variables
Outputs/Debugging
Lists
Miscellaneous
100

What does += do?

Adds a value to a variable and assigns its new value.

100

Is "2var" a legal variable name?

No, variables cannot start with a number

100

What is wrong with the following code: 

print(I love Coding Academy)

The print function needs quotations around the string.

print("I love Coding Academy")

100

What function is used to find the length of a list?

len()

100

How do you create/establish a function?

You define it using def().

200

What are nested loops?

A loop inside of a loop. 

200

What are the two (technically three) types of variables?

Strings and Integers (and Float)

200

What is wrong with the following code:

thislist = ("red", "yellow", "green")

Lists need brackets instead of parentheses.

thislist=["red", "yellow", "green"]

200

Why would someone use a list?

To store multiple items in a variable. 

200

What are if/else statements called?

Conditionals

300

What is used to fix a for loop to run for a specific amount of times? 

range()

300

What does the != operator mean?

Not Equal

300

What will the following code display:

for x in range(5, 30, 6): 

   print(x)

5, 11, 17, 23, 29

300

When creating lists, what do you need to add to strings but not integers or Booleans? 

Quotes

300

Describe what a function is and why we use them. 

A function is a chunk of code that runs when it is called. Using functions can refine and organize code by establishing what each chunk of code does.

400

In a range function, what does each number represent in range( 6, 30, 5)?

range(min, max, increment value)

400

What does case sensitive and does it apply to variables?

Case sensitive means to be specific about upper/lower case. This applies to variables. 

400

What will the following code do:

fruits = ["apple", "oranges", "cherries"]

fruits.pop(1)

print(fruits)

It will print the list without oranges.

400

How do you add an item to the end of a list?

Use the append() function

Ex.

thislist.append("orange")

400

How do you make comments in Python?

You use the # symbol. 

500

What is the difference between for loops and while loops?

While loops execute while a condition is true, while for loops executes through a sequence (no condition needs to be met).

500

What type of values can variables hold?

Strings, Integers, and Floats

500

What will the following code do:

i = 1

while i < 11:

   print(i)

   i += 1

It would print the integers 1-10.

500

How is the append function and the insert function different?

The append function adds to the very end of the function while the insert function can insert an item anywhere on a list.

500

What is type casting?

The conversion of strings to integers or integers to strings. 

M
e
n
u