A blueprint for creating objects.
What is class?
This common variable type stores letters, numbers, and symbols.
What is a string?
This often used statement checks the validity of a statement before creating a branch.
What is an 'if' statement?
To comment a line in Python, you use this/these character(s).
What is a pound sign (#) ?
An object created from a class.
What is an Instance (object)
This variable type stores decimal numbers.
What is a float?
This flow control statement loops through a set of statements if a test statement continues to evaluate to True.
What is a for/while loop?
This commonly used Python data structure contains a collection of items referenced by a numeric index.
What is a list?
Identify the letter printed from these lines of code: words = "Python Rules!" print words[8]
What is 'R'?
Fill in the blank:
class Dog: def bark(_____):
print("Woof!")
What is self?
Which variable name is NOT valid in Python?
- student_name
- student1
- 1student
- student_name_2
What is 1student?
What is the value of 'x'?
x = 10
if x > 5:
print("A")
else:
print("B")
What is A?
Data structure stores information using key : value pairs?
What is a dictionary?
What prints?
word = "Python"
print(word[0])
What is P?
What the object has (color, speed, name)
What is attribute
Data stored as a string is surrounded by these.
What are quotes?
This type of operators allow you to string together tests in an 'if' statement.
What is a Boolean operator?
What prints?
colors = ["red","blue","green"]
print(colors[1])
What prints blue?
What prints?
word = "Python"
print(word[-1])
What is n?
*Denoted as '%', this operator returns the remainder of a division operation.
What is the modulus?
To determine the variable type of a variable, you would use this function.
What is type()?
What is printed?
numbers = [3, 5, 7]
numbers.append(9)
print(numbers[2])
What is 7?
This built-in Python function returns the length of many objects, including Lists.
What is len()?
Denoted as '%', this operator returns the remainder of a division operation.
What is the modulus?