1/33
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Numeric - All Numbers
integers, floating-point numbers, complex numbers
Boolen Values (technically numeric: 0-Fals, 1-True)
Sequences - Order Collection
lists, typles, ranges
strings ( a seqience of characters)
Mapping - Key Value Collections
dictions
Integers
whole number of any size or any value without a decimal
Floating-Point Numbers or Float
decimal numbers with precision up to 14 decimal places
not a number (nan)
negative infinite (-inft)
positive infinite (+inf)
Bankers Rounding / Rounding Half to Even
will always prefer the closest even integer
Complex
numbers with a real and an imaginary part. Any numeric value with the suffix “j“
Example: complex_num - 12 + 2j
Boolen
This data type represents two values of true or false. Capitalize True or False
Sequence - Strings
Represented by enclosing the value in a single or double quotes
len():
return the # of characters; length of the string
replace():
replaces part of the string with another
lower/upper ():
changes strings with either lower/upper case
isnumeric():
checks if the string is a number
split():
splits strings into separate parts
int():
This function converts any value you define in between the parentheses into an integer type
float():
This function converts any value you define into a float type
str():
Convert any value you define into a string function
Concatenation
Operation of “gluing” string values together
uses the “+” operator
cannot perform addition with a concatenation
F-string
allows you to embed variables or expressions directly inside a string
Rounding
Add a : after the float vale then add a period. Followed by a number to the decimal place, add F if you want it fixed.
Escape Sequences
A special type of character that we can use to represent characters or formatting into a string
\ → escpae sequence
/b:
backspace
\n:
new line
\t:
tab(indentation)
\”:
double-quote
\\:
backslash
\’:
single-quote
Expression
A combination of values, variables, and operators that your computer will calculate into a value.
Literals
Simplest expressions since they do not need evaluation since they are values themselves
Operators
Whenever you use any operators, like mathematical operators
Function Call
Some are expressions, the computer must evaluate the value it returns
Logical Operators
not, and, or
Comparison Operators
== : equality
!= : inequality
> : greater than
< : less than
>=: greater/equal to
<=: less than/equal to
in, not it, is, is not