This often comes after if/elif
What is else?
This function returns the length of a variable.
len()
This is the operator used to concatenate.
+ (addition operator)
This is the character returned by "theCoderSchool"[5]
What is "d"?
This is a way of repeating a set of code many times
What is a loop?
What is # used for in python?
This symbol is used to comment out one line of code.
4**2 is equal to this number.
What is 16?
This is considered a good first programming language and generally the first language learned by programmers.
What is Python?
Boolean operators provide these as answers.
What is true and false?
Variables can be defined both inside or outside of a function. This determines if a variable is inside or outside of the function.
What is spacing or indent?
This is used to create multi-line comments.
""" or ''' (triple quotes)
def letter_grade(score):
if score <60:
return "F"
elif score <70:
return "D"
else:
return "C or higher"
print(letter_grade(85))
What is C or higher?
This is an error that occurs when a character is incorrectly placed.
What is a syntax error?
If you want to add programmer to this list....
careers = ["doctor", "teacher", "accountant"]
careers.append("programmer")
What is modulo/modulus?
This operation is represented by % to get the remainder.
The answer for this problem:
x<5 or x<4
What is true?
Determine the function name and the string.
def family():
print ("My family has pets")
family()
What is family and My family has pets?
This is a particular type of list
children = []
What is an empty list?
Here's a bit of code. It would print:
season = "Spring is the best"
for i in range(5):
print(season)
What is
Spring is the best
Spring is the best
Spring is the best
Spring is the best
Spring is the best
Many companies require you to do this before you publish your programs for use.
What is test and debug?