Comp lecture 2 - Variable types Flashcards
Literals
Literals are constant values
Variable
Variables are names for values
Operator
An Operator is in between two arguments and performs a particular operation on the two arguments
Assignment
When the variable is assigned or equated to a value
Syntax rules for python’s variable names
- the first character should always be an underscore or an alphabet
- following characters can be alphabets, digits or underscores
- meaningful names that make the program readable to others
What is the PEMDAS rule and where is it used?
Parentheses > exponents > (multiplication,division) > (addition, subtraction)
It used for evaluating expressions constituting of more than one operators - tells us which operation to perform first
What is an object? What is the characteristic of an object and how does this characteristic help us?
Every value python can compute is an object.
Every object has a type.
And this tells us the different operations we can perform on the object