Variables Flashcards
What is the purpose of variables?
To store a value
What are data types?
It describes what type of information is being stored.
What are variable declarations?
It is when you create a variable and assign it a value.
Should quotation marks be used when printing a variable?
No
When naming a variable, what must you start with?
Letter or underscore
Are variables case sensitive?
Yes. Variable, variable and, VARIABLE are all different variables.
Name some python key words. These words are not allowed to cannot be used as variables.
and, as, assert break, class, continue, del, elif, else, except, FALSE, finally, for, from, global, if, import, is, lambda, None, nonlocal nont, or, pass, raise, return, TRUE, try, while, with yield
What happens if you write:
my_variable = “Hello world”
my_variable = “Goodbye world”
The second line overwrites the first line. So my_variable value is Goodbye world.
What are string variables
It is a collection of text, numbers of symbols
What do Boolean values represent?
True or false statements
Boolean values are case sensitive, do they need to be uppercase or lowercase?
Uppercase
When printing an number, what do you use as a variable?
interger_variable
What should you avoid when typing intergers?
Commas
When is a float variable used?
When there is a decimal