Section 2 Flashcards
What is a variable?
Is used in programming to store data
What is a constant?
Is a variable that cannot be changed during the execution of the program
Data Type: String
zero or more characters in a quote mark
Data Type: Real/Float
Decimals
Data Type: Boolean
Only accepting true or false
What is camelCase and its advantages?
To separate words by making first letter of second word capitalized
Advantages are: Easier to remember Consistent
What is snake_case?
Where all words are in lowercase and are separated by an underscore
E.G. max-number-of-players
Could be used to name functions
What is PascalCase?
Each word separated by capitalizing the first letter of each word?
String conversion: int(input(
Allows integer to be an input or part of string
String conversion: float(input(
Allows decimal to be an input or part of string
String conversion: str
Just means string
To add
+
To subtract
-
To multiply
*
To divide
/
MOD(modulus)
%(finds the remainder)
DIV(quotient)
// finds the quotient (the number before the decimal point)
Exponentiation
^/** used to find the power