variable naming rules & data types Flashcards
1
Q
what are the variable naming rules
A
- consistency: ‘name’ is not the same as ‘Name’ or ‘NAME’
- spacing: variable names do not have spaces in them, use an underscore or camelCase
- digits: variable names do not begin with digits
2
Q
what are the data types
A
- string [str]- used for a combination of characters on the keyboard
- characters [char]- used for single letters
- integer [int]- used for whole numbers
- float or real - used for fractions and decimals
- boolean [bool.]- used for true / false, yes/no or male / female questions [questions with only two outcomes].