Used to add a single element to the end of a list
What is append()
Used to remove an item from a list by index number
What is pop()
Used to convert a piece of data into a Boolean
What is bool()
print("hello world"
What is a missing parenthesis
Symbol used to see if two items are identical
What is ==
Method used to divide a string into a list
This statement checks a single condition. It comes first in the order of condition-checking statements
What is an if statement
Used to display information on the screen
What is print()
name = "Hello Jane"
print("name")
What is name shouldn't have quotation marks around it since it is a variable, not a string
Used to gather information from the user
What is input()
Used to store information in Python
What is a variable
What is concatenation
my_string = "Hello, world!"
first_char = my_string[0]
print(first_char)
What is H
name = "Jane"
if name == "Jane"
print("Hello Jane")
elif name == "Jack":
print("Hello Jack")
What is we are missing a colon at the end of the if statement
Used to convert a piece of data to a string
What is str()
This type of statement checks any conditions that come after the first one
What is an elif statement
This arithmetic operator divides but returns the remainder
What is modulus/modulo %
my_string = "Hello, world!"
substring = my_string[7:12]
print(substring)
What is world
name = input("What is your name?")
print("Hello" name)
What is we are missing the plus sign to combine the string and variable together
This statement is what occurs if every condition previously checked was false
What is an else statement
The third number in the parentheses is known as...
ex:
for x in range(0, 10, 2):
What is step
people_in_line = people_in_line + 1
What is people_in_line += 1
Allows you to iterate over a sequence of items in Python
What is a for loop
name = "Jane"
if name = "Jane":
print("Hello Jane")
elif name == "Jack":
print("Hello Jack")
What is we are missing an equal sign in our if statement, since we use two equal signs to compare things
Used to convert a piece of data into a float
What is float()