|
41 | 41 | * We can import a module using `import` keyword.
|
42 | 42 | * If it is not available it will give import error.
|
43 | 43 | * dir() method tells what the attribute provides.
|
| 44 | +* What's The [Zen](https://www.python.org/dev/peps/pep-0020/) of Python ? |
44 | 45 | ```
|
| 46 | +>>> import this |
| 47 | +The Zen of Python, by Tim Peters |
| 48 | + |
| 49 | +Beautiful is better than ugly. |
| 50 | +Explicit is better than implicit. |
| 51 | +Simple is better than complex. |
| 52 | +Complex is better than complicated. |
| 53 | +Flat is better than nested. |
| 54 | +Sparse is better than dense. |
| 55 | +Readability counts. |
| 56 | +Special cases aren't special enough to break the rules. |
| 57 | +Although practicality beats purity. |
| 58 | +Errors should never pass silently. |
| 59 | +Unless explicitly silenced. |
| 60 | +In the face of ambiguity, refuse the temptation to guess. |
| 61 | +There should be one-- and preferably only one --obvious way to do it. |
| 62 | +Although that way may not be obvious at first unless you're Dutch. |
| 63 | +Now is better than never. |
| 64 | +Although never is often better than *right* now. |
| 65 | +If the implementation is hard to explain, it's a bad idea. |
| 66 | +If the implementation is easy to explain, it may be a good idea. |
| 67 | +Namespaces are one honking great idea -- let's do more of those! |
| 68 | + |
45 | 69 | >>> import math
|
46 | 70 | >>> dir(math)
|
47 | 71 | ['__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'e', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'gcd', 'hypot', 'inf', 'isclose', 'isfinite', 'isinf', 'isnan', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'log2', 'modf', 'nan', 'pi', 'pow', 'radians', 'remainder', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'tau', 'trunc']
|
|
0 commit comments