Python Flashcards
(255 cards)
Front_Card
Back_Card
-
Subtraction 2 - 4 == -2
/=
Divide and assign x = 1; x /= 2
@
At (decorators)
@classmethod
*=
Multiply and assign x = 1; x *= 2
**
Power of 2 ** 4 == 16
%
String interpolate or modulus
2 % 4 == 2
:
Colon def
X():
+
Addition
2 + 4 == 6
> =
Greater than equal
4 >= 4 == True
<=
Less Than equal
4 <= 4 == True
[ ]
List brackets
[1,3,4]
-=
Subtract and assign x = 1; x -= 2
+=
Add and assign
x = 1; x += 2
=
; semi-colon print(“hi”); print(“there”)
**=
Power assign x = 1; x **= 2
{ }
Dict curly braces
{‘x’: 5, ‘y’: 10}
//=
Floor divide and assign
x = 1; x //= 2
*=
Multiply and assign x = 1; x *= 2
( )
Parenthesis
len(‘hi’) == 2
!=
Not equal
4 != 5 == True
%=
Modulus assign
x = 1; x %= 2
,
Comma range(0, 10)
//
Floor division 2 // 4 == 0