Strings and Lists Flashcards
Identifier
Variable Name
Literals
Directly represents a fixed value
\n
Linebreak, newline charactor
\
Escape charactor. Interprets in an alternative way (ignores quotes…etc)
”””
Doesn’t close a string until another set of “””
Len()
Function that shows the number of characters in a string or length of a string
Indexing
“Hello”[0] ->’H’. Can be used on strings and lists to access a specific part of them
Index Operator
[]
range(x, y, z)
x= start, y= stop, z= step
Index Numbers
The numerical representation of the positions of elements within a sequence (string or list)
Slice
Piece of a string, starting from some position and extending to another position
Int function
Converts a value to an integer ex: int(“3”) = 3
Float function
Converts a value into a floating point value ex: float(“34.4”) = 34.4
Predicates
Returns true or false to indicate something.
Boolean Statements
True and FalseB