Variables - BenWare-FED/Python GitHub Wiki
Variables: A data storage contains with a label(Identifier) attached. All variables have an identifier, data(value), and a type of data. Python autoassigns type of data.
Identifier(Label)(keywords): Name given to the variable.
Identifier rules:
- Python is case sensitive. ex pi Pi and PI are all different
- You can start the identifier with a letter or an underscore but never with a number.
- Identifiers cannot contain special characters other than underscore.
- There are predefined identifiers known as key words, don't use them as identifiers ex: print, if, for, while, else, True, False.
- Identifiers can be as long as you want as long as you follow da rulez.
Data Types:
- To store numerical values
A. Integer: Whole numbers
B. Float: p/q when q doesn't equal zero. Whole number plus a decimal.
- To store categorical values
A. Strings: Stores characters. stored within " " ex "strings" "l" "3894573289hfiusdrhi,./?":)(*&^%"
B. Boolean: True, False
Styles
Camal case: areaOfCircle
Pascal case: AreaOfCircle
Snake case: area_of_circle