Last active
August 29, 2015 14:11
-
-
Save adammbalogh/3a6ad03cbaedc7b6c7ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = None | |
a is not None # False | |
t = (1, 2, 3) | |
2 in t # True | |
a = 10 | |
7 < a <= 10 # True | |
def is_float_equal(a, b): | |
return abs(a - b) <= sys.float_info.epsilon | |
blank_str = ' ' * 9 # ' ' | |
"Hello {name}".format(name="Adam") # Hello Adam | |
b = 'lesser' if 5 < 6 else 'greater' # 'lesser' | |
a_list = [1 for x in range(5)] # [1, 1, 1, 1, 1] | |
def setup(*, param1=1, param2=2): # you have to call this method with key-value params or withouth any params | |
pass | |
params = dict(param1=5, param2=6) | |
setup(**params) | |
def print_args(*args, **kwargs): # args are simple params, kwargs are dictionary params | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment