| Commit message (Collapse) | Author | Age | Lines |
| |
|
|\
| |
| | |
[python3/en] A note about common gotcha with mutable defaults
|
| |
| |
| |
| | |
A reminder to be aware of using mutable defaults.
Whether it is a real problem or not depends on exact use-case, but an update fully describing that and updating code with copying list, or defaulting with None and conditional initialization, would probably negatively affect readability of the example.
|
|/
|
|
|
| |
* Add changes to dict item ordering in Python 3.7+
* Fix line length
* Fix typo in example
|
|\
| |
| | |
[python3/en] show chaining operators nicer
|
| | |
|
|/
|
|
|
|
|
|
| |
* [python3/en] show that True and False are ints
* [python3/en] rework some boolean stuff
I removed the example `-5 != False != True #=> True` because we didn't cover chaining yet.
|
| |
|
| |
|
|
|
| |
I indicate that a set doesn't contain duplicate elements and add a little example
|
|
|
| |
Literal string interpolation is new in python 3.6 [pep-0498](https://www.python.org/dev/peps/pep-0498/)
|
| |
|
|\
| |
| | |
[python3/en]: fix typo
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
2^4 == 4^2, 2^3 seems a bit less ambiguous as an example for exponentiation.
|
|
|
| |
property is exposed using setter and getters
|
|
|
|
| |
A fix on static method section (around line 728).
Specifically, i.grunt() should raise an error since grunt() is a static method and 'i' is an instance of the class.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* [python3/en] Add empty tuple to "False if evaluated" list
* [python3/en] Fixed "StopIterator Exception" - no such exception
|
| |
|
|
|
|
|
|
|
|
| |
The result of division is always a float.
e.g.
35/5 = 7.0
10 / 3 = 3.3333333333333335
10.0 / 3 = 3.3333333333333335
10 / 3.0 = 3.3333333333333335
|
|
|
|
|
| |
* explain that you can place the human and bat classes into seperate
files
* explain how to import specific functions from other files
|
|
|
|
|
|
|
|
|
|
| |
* updated docs on division for python3
prev. docs were confusing, did not show how to actually divide.
* modified language about python division
* fixed grammar
|
| |
|
| |
|
|
|
|
|
|
| |
* add new book
* sanitized link
|
| |
|
|
|
|
| |
The previous version of this file had the original Dive Into Python, which was written with Python 2 in mind.
It has come to my attention that the author of the original has published an updated version designed for Python 3, so I added this version back in.
|
|
|
| |
There were several resources here that teach Python 2, but not Python 3. I removed them so that a reader will only see resources that apply to Python 3.
|
|
|
|
|
|
|
|
| |
* Add set and dict comprehensions for python 2 and 3
* Clean up formatting and generator explanation
* Include documentation for generator comprehensions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add __name__ check to make testing easier
* Update say to call print. Add more usage examples
* Move Modules section before Classes
Makes more sense for when explaining inheritance
* Add multiple inheritance example
* Add examples for multiple inheritance
* Add instance check examples
* Fix multiple inheritance example
* Add note on the __name__ variable
|
| |
|
|
|
| |
Remove TODO
|
|
|
|
|
|
|
|
|
| |
The same happens for `filter`.
```pythob
filter(lambda x: x > 5, [3, 4, 5, 6, 7])
<filter at 0x110567320>
list(filter(lambda x: x > 5, [3, 4, 5, 6, 7]))
[6, 7]
```
|
|
|
| |
`map` requires `list` in order to convert the mapping to its list. E.g. `<map at 0x11057ce48>` to `[11, 12, 13]`.
|
|\
| |
| | |
[python/en] Add note about Python Module Order of Import
|
| | |
|
|\ \
| | |
| | |
| | |
| | | |
ankitaggarwal011/python3-ternary-operator-documentation-add
[python3/en] Adding documentation on ternary operator
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
# Conflicts:
# python.html.markdown
|
| | | | |
|
|/ / / |
|
| | |
| | |
| | |
| | |
| | | |
list.index(argument) would return the index of the item in the list that first matched the argument
It will not return the value stored at the index of the argument as it was prior.
Added some more clarity to the subject as well.
|