CH 2 - PYTHON FUNDAMENTALS (Module 2) Flashcards
1
Q
token/ lexical unit
A
- in a text, individual words and punctuation marks
- smallest individual unit in a proram
2
Q
5 tokens in python
A
- KEYWORDS
- IDENTIFIERS (NAMES)
- LITERALS
- OPERATORS
- PUNCTUATORS
3
Q
which is the smallest individual unit in a program
A
TOKEN or LXICAL UNIT
4
Q
- keywords
A
- words that convey a special meaning to the language compiler/ interpreter
- reserved for special purpose
- cant be used as identifier names
- print, true, false, for, in, while, elif, none
5
Q
- identifiers/ names
A
- fundamental building blocks of a program
- arbitrary long sequence of letters and digits
- used as the general terminology for the names given to different parts of the program viz. variables, objects etc
6
Q
constraints in naming identifiers
A
- first character:
i. must be letter or underscore (_)
ii. cant start with number
iii. cant start with a special character - CANT be a reserved python KEYWORD
- python is a case sensitive language. case of letters is significant
- CANT have a special character
- CAN be a NUMBER
7
Q
- literals or values
A
data items that have a fixed value
8
Q
types of literals/ values
A
- string literals
- numeric
- boolean
- special literal - NONE
- literal collections
9
Q
ESCAPE SEQUENCES - \
A
adds backslash
10
Q
ESCAPE SEQUENCES - '
ESCAPE SEQUENCES - "
A
adds single quote
adds double quote
11
Q
ESCAPE SEQUENCES - \a
ESCAPE SEQUENCES - \b
ESCAPE SEQUENCES - \f
A
ASCII bell (BEL) ASCII backspace (BS) ASCII formfeed (FF)
12
Q
ESCAPE SEQUENCES - \n
A
new line character
13
Q
ESCAPE SEQUENCES - \N[name]
A
14
Q
ESCAPE SEQUENCES - \r
ESCAPE SEQUENCES - \t
A
carriae retrn (CR) horizontal tab (TAB)
15
Q
- Operators
A
- tokens that trigger some computation when applied to variables and other objects in an expression