| Commit message (Collapse) | Author | Age | Lines |
|\
| |
| | |
[Python3/en] copy sets
|
| | |
|
|\ \
| | |
| | | |
Explaining better and improving consistence
|
| |/
| |
| |
| | |
Added a version without parentheses to make it clear what they are doing;
Added return values for True and False because 3 also has it.
|
|\ \
| |/
|/| |
[python/en] don't overwrite list function
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
problem:
assigning a list of animals to the list variable overwrites the list function, so that later in line 531 the list function is not available and raises a Type Error:
```
In [133]: list(filled_dict.keys())
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-133-a2c520b90051> in <module>
----> 1 list(filled_dict.keys())
TypeError: 'list' object is not callable
```
solution:
use another variable name instead of list
|
| | |
|
|/
|
|
| |
example (closes #3586)
|
| |
|
| |
|
|
|
|
|
|
| |
* Added enumerate function
* adjusted spacing
|
| |
|
| |
|
|\
| |
| | |
[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
|