Notebook 4: Floating Point Flashcards
ord()
returns the number representing the unicode value of a character
isalpha()
returns true if all characters in string are alphabet letters a-z
floating point representation
Value=Sign × Significand × Base^Exponent
floating point representation - sign
indicates if number is positive or negative
floating point representation - significand (Mantissa)
represents the precision of the number
floating point representation - base
the base of the number. 10 for regular numbers and 2 for computers usually
floating point representation - exponent
determines the scale of the number
hex format
a way of representing numbers using a base of 16, or hexadecimal
ex:
‘-0x1.4002000000000p+10’
sign of the number is first
prefix 0x that means it’s hexadecimal notation
1.4002…. is the significand in base-16 (hexadecimal)
p+ means power of 2 and the following number tells us how many places to shift the significand + scales the number
strip()
In Python, the strip() method is used to remove leading and trailing characters from a string. By default, it removes whitespace characters (spaces, tabs, newlines, etc.).
lstrip / rstrip
In Python, lstrip() and rstrip() are string methods used to remove leading and trailing characters from a string, respectively.
list slicing
list_name[start : end : step]