That's so fetch
Feelin' Loopy
Function Junction
Basic B-ug
Code for your life.
100

This variable type stores decimal numbers

Float

100

This type of loop runs forever as long as a condition is True

while

100

All functions/methods are required to have this

Parenthesis

100

To document code (or multiline comment) we use what?

"""

"""

(triple quotation start and end)

100

Write an if statement that checks if a number is positive.

if(num > 0):

200

This method always returns a string from user data.

input()

200

What keyword stops a loop immediately?

break

200

This method/function returns the number of characters in a string

len()

200

Since it's not compiled, Python is this type of language.

Interpreted / Scripted

200

word = "burger king"

what is the code needed to output "burger" and "king" on 2 separate lines.

print(word[0:6])

print(word[7:])

300

num = int(num)

What is the purpose of this python statement?

Turn the variable number into an integer datatype

300

for i in range(0,5):

     print(i, end="")

What is the output of this for loop?

01234

300

This method divides a string into a list of substrings based on a specific delimiter.

split()

300

This category of error is often the most difficult to find as there are never any error messages shown by the interpreter

Logic errors

300

Write a branching statement that outputs the word "FizzBuzz" if a number is a multiple of both 3 and 5

if(num % 3 == 0 and num % 5 == 0):

    print("FizzBuzz")

400

What is the point of the parameter "end=" within the print() function?

controls what is appended to the end of the output

400

This operator allows us to loop through a container of data

in

400

This function returns False if all characters in a string are not upper or lowercase letters, or numbers 0-9

isalnum()

400

word = "gulf coast"

print(word[20])

This code demonstrates what error?

Runtime error

400

Write a loop that validates a variable to be a number that's in range between 0 and 10

while not num.isdigit() or int(num) <= 0 or int(num) >= 10:

500

x = "hello" y = "world"

What does print(x[1:],y)

ello world

500

for letter in "dog":

    print(letter)

What is the above output?

d

o

g

500

This method would be used to swap every instance of a substring for another

replace()

500

number = 5

if(number = 5)

   print("Yes")

What are 2 issues with this code?

we use == for if statement comparison

missing colon after if statement

500

Code a loop that sums all even numbers between 0 and 100

total = 0

for x in range(0,101,2):

    total += x

print(total)

M
e
n
u