You should use this symbol for commenting a line of code
#
We use this function to show the user words as a form of output.
print()
A while loop is most useful for things like an atm or ordering at a resturtant because we can create this with it.
Menu
While for loops can have other functions. This is the main function we use in for loops.
range()
A function runs this many times when called
1
Fixed values such as number, letters, and strings are called this
Constant
What is the output?
x = ‘hello’ + ‘there’
x = x + 1
print(x)
Error
You can use this word to stop your code during a loop.
Break
By default we always increment by this number in a for loop
1
Where can you call a function in your code?
anywhere
Input is always defined as this type unless otherwise stated.
String
I could use this escape character to start a new line in a print statement
\n
A while loop checks this at the end of each run through
Condition
We can use this code to print horizontally instead of printing vertically
End
Unlike an argument, that resides in the calling of the function. This resides in the definition of a function.
Parameter
In order List the Order of Operations for Logic
Parentheses
NOT
AND
OR
What code would I use to output 2 + 2 as a string literal
print("2 + 2")
If a while loop never affects the condition. This will occur.
Infinite Loop
To skip printing a specific item you can use this word.
Continue
The number of arguments has to do this with the number of parameters if there is no default parameter.
equal
Reserved Words
If/else statements are useful for printing specific parts of code. These statements can also be refer as this.
Conditionals
How many times would this code run?
apollo = 1
while (apollo < 13) :
print("Duct tape can fix anything.\n")
apollo = apollo + 2
6
What is the output of this code?
for x in range(2, 6):
print(x)
x = x + 1
2
3
4
5
You would use this word when using a function to do math.
Return