4. Numbers, Boolean, None, Value and more. Flashcards
Data type in Python
integer - int
floating-point numbers - float
string - str
boolean - bool
Result of a floating-point division (/) is always _________
float
Result of other operations…
float - if either num is float
int - if otherwise
True and False first letter must be
CAPATILISED
How to write an operation for square root?
**(decimal/fraction)
How ‘and’ works
Returns True if both left
and right are true
How ‘or’ works
Returns True if either the
left or the right is true.
How ‘not’ works
Returns True if the value
being tested is False
None Value represent
- Represent null values or nothingness.
* Not the same as False, or an empty string, or 0
To write comment, we need to add ____ infront
#
Type of comment
Block Comments = indented at the same level as the code block
Inline Comments = placed on the same line as a statement
a = a + b →
a += b
a = a * b →
a *= b
a = a // b →
a //= b
a = a % b →
a %= b