Lesson 7 Flashcards
Variables purpose?
To store information multiple times throughout a program.
4 basic types of data used in python
strings
integers
lists
Boolean values
Lists
ordered sequence of values
Strings
Represent text
Boolean values
Represent true or false
Identifier is the name of the vairable
Don’t include spaces or symbols in identifiers
Naming convention
A format for naming things like variables
Pascal case for naming conventions
JollyRoger, NoWay
Camel Case for naming conventions
heyOh, forReal, buriedTreasure
Strings?
A group of sequenced characters within either single or double quotation marks.
Assign a variable a string value?
Just use the operator the equal sign. When text is in quotation marks python recognizes it as a string and not a variable
Three single quotation marks ( ‘’’ )
It allows you to enter text the exact way you want it to appear
You can reuse variable names
Just assign the variable a new value and it will overwrite the original value.
Escape character
Tells python to treat that character as a part of the string instead of a special character. "tornado" would fix the issue.