1
0
mirror of https://github.com/satwikkansal/wtfpython synced 2024-06-03 11:58:02 +02:00

Add Example Structure and Usage instructions sections.

This commit is contained in:
Satwik Kansal 2017-08-30 16:50:39 +05:30
parent 0aef185848
commit f0c254b106

View File

@ -64,27 +64,49 @@ So, here ya go...
<!-- END doctoc generated TOC please keep comment here to allow auto update --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->
# 👀 Examples # Structure of the Examples
**Environment:** All the examples mentioned below are run on Python 3.5.2 interactive interpreter unless explicitly specified. Almost all the examples are structured like below:
## Example heading ```
## Some fancy title
One line of what's happening: (Optional) One line of what's happening:
```py ```py
setting up Preparing for the magic
``` ```
**Output (Python version):**
```py ```py
>>> triggering_statement >>> triggering_statement
weird output Probably unexpected output
``` ```
### Explanation: **Note:** All the examples mentioned below are run on Python 3.5.2 interactive interpreter unless explicitly specified.
* Better to give outside links
* or just explain again in brief ### Explanation:
* Brief explanation of what's happening and why is it happening.
```py
Setting up examples for clarification (if required)
```
**Outupt:**
```py
>>> trigger #some example that makes it easy to unveil the magic
# some justified output
```
```
# Usage
A good way to go through these examples in my opinion will be to just to read them chronologically, and for every example:
- Carefully read the initial code for setting up the example. If you're an experienced Python programmer, most of the times you will successfully anticipate what's gonna happen next.
- Read the output snippets and check if
+ The outputs are the same as you'd expect.
+ You know the exact reason behind the output being the way it is. If no, read the explaination (and if you still don't understand, shout out and create an issue [here]()). If yes, give a gentle pat on your back and you may skip to the next example.
# 👀 Examples
## `datetime.time` object is considered to be false if it represented midnight in UTC ## `datetime.time` object is considered to be false if it represented midnight in UTC