Skip to content

Commit 603a096

Browse files
committed
Small fixes
1 parent 15c65ea commit 603a096

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ from functools import lru_cache
676676

677677
@lru_cache(maxsize=None)
678678
def fib(n):
679-
return n if n < 2 else fib(n-1) + fib(n-2)
679+
return n if n < 2 else fib(n-2) + fib(n-1)
680680
```
681681

682682
### Parametrized Decorator
@@ -927,8 +927,8 @@ print(<el_1>, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
927927
Input
928928
-----
929929
* **Reads a line from user input or pipe if present.**
930-
* **The trailing newline gets stripped.**
931-
* **The prompt string is printed to standard output before reading input.**
930+
* **Trailing newline gets stripped.**
931+
* **Prompt string is printed to the standard output before reading input.**
932932

933933
```python
934934
<str> = input(prompt=None)
@@ -958,14 +958,14 @@ Open
958958
* **`'x'` - Write or fail if the file already exists.**
959959
* **`'a'` - Append.**
960960
* **`'w+'` - Read and write (truncate).**
961-
* **`'r+'` - Read and write from the beginning.**
961+
* **`'r+'` - Read and write from the start.**
962962
* **`'a+'` - Read and write from the end.**
963963
* **`'t'` - Text mode (default).**
964964
* **`'b'` - Binary mode.**
965965

966966
### Seek
967967
```python
968-
<file>.seek(0) # Move to start of the file.
968+
<file>.seek(0) # Move to the start of the file.
969969
<file>.seek(offset) # Move 'offset' chars/bytes from the start.
970970
<file>.seek(offset, <anchor>) # Anchor: 0 start, 1 current pos., 2 end.
971971
```
@@ -1274,6 +1274,9 @@ from collections import deque
12741274
```python
12751275
<deque>.appendleft(<el>)
12761276
<el> = <deque>.popleft()
1277+
```
1278+
1279+
```python
12771280
<deque>.extendleft(<collection>) # Collection gets reversed.
12781281
<deque>.rotate(n=1) # Rotates elements to the right.
12791282
```

0 commit comments

Comments
 (0)