variable naming rules & data types Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

what are the variable naming rules

A
  1. consistency: ‘name’ is not the same as ‘Name’ or ‘NAME’
  2. spacing: variable names do not have spaces in them, use an underscore or camelCase
  3. digits: variable names do not begin with digits
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are the data types

A
  1. string [str]- used for a combination of characters on the keyboard
  2. characters [char]- used for single letters
  3. integer [int]- used for whole numbers
  4. float or real - used for fractions and decimals
  5. boolean [bool.]- used for true / false, yes/no or male / female questions [questions with only two outcomes].
How well did you know this?
1
Not at all
2
3
4
5
Perfectly