Python's namedtuples can be a great alternative to defining a class manually
#pytrick
#pytrick
You can use "json.dumps()" to pretty-print Python dicts
... (as an alternative to the "pprint" module)
#pytrick
... (as an alternative to the "pprint" module)
#pytrick
functools — Higher-order functions and operations on callable objects
partial gives default values to the parameters of a function that would otherwise not have default values.
#pytrick
partial gives default values to the parameters of a function that would otherwise not have default values.
#pytrick
Python's list comprehensions are awesome
even_squares = [x * x for x in range(10) if not x % 2]
#pytrick
even_squares = [x * x for x in range(10) if not x % 2]
#pytrick
روشی که برای تولید تمام حالت ها در brute-force پسوردها هم استفاده میشود!
itertools.permutations() generates permutations for an iterable.
#pytrick
itertools.permutations() generates permutations for an iterable.
#pytrick