Module 2 - Anatomy of a Python Statement Flashcards
what can python statements do?
Creating data objects
Giving names to data objects
Performing operations on data objects
Use properties of data objects to execute other statements conditionally and/or repeatedly
yypes of python statements
simple statements and compound statements.
simple statement.
one line of code
compound statements.
contain multiple commands or instructions that are dependent on each other in some ways
tokenization
breaking up the statement into so-called tokens.
Tokens
smallest meaningful unit in a Python program. composed of sequences of characters
types of tokens
- Keywords
- Identifiers
- Literals
- Delimiters
- Operators
- Whitespace Tokens
character
alphabet, a number, a punctuation or a symbol like +, *, &, ^, etc.
Keywords
words reserved for a specific purpose
Identifiers
used to refer to objects in memory
features of an identifier
begins w letter or underscore
optionally, continues w letter, digit, or underscore
cannot be a python keyword
is python case-sensitive?
yes. uppercase and lowercase letters are considered different characters.
Literals
used to represent constant, fixed values in your program
types of literals
integer literals
floating point literals
string literals
integer literals
Integer literals are tokens made up of one or more digits and no other characters.
floating point literals
tokens used to represent a real number.
A float literal contains a dot (.) and one or more digits.