@@ -676,7 +676,7 @@ from functools import lru_cache
676
676
677
677
@lru_cache (maxsize = None )
678
678
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 )
680
680
```
681
681
682
682
### Parametrized Decorator
@@ -927,8 +927,8 @@ print(<el_1>, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
927
927
Input
928
928
-----
929
929
* ** 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.**
932
932
933
933
``` python
934
934
< str > = input (prompt = None )
@@ -958,14 +958,14 @@ Open
958
958
* ** ` 'x' ` - Write or fail if the file already exists.**
959
959
* ** ` 'a' ` - Append.**
960
960
* ** ` 'w+' ` - Read and write (truncate).**
961
- * ** ` 'r+' ` - Read and write from the beginning .**
961
+ * ** ` 'r+' ` - Read and write from the start .**
962
962
* ** ` 'a+' ` - Read and write from the end.**
963
963
* ** ` 't' ` - Text mode (default).**
964
964
* ** ` 'b' ` - Binary mode.**
965
965
966
966
### Seek
967
967
``` python
968
- < file > .seek(0 ) # Move to start of the file.
968
+ < file > .seek(0 ) # Move to the start of the file.
969
969
< file > .seek(offset) # Move 'offset' chars/bytes from the start.
970
970
< file > .seek(offset, < anchor> ) # Anchor: 0 start, 1 current pos., 2 end.
971
971
```
@@ -1274,6 +1274,9 @@ from collections import deque
1274
1274
``` python
1275
1275
< deque> .appendleft(< el> )
1276
1276
< el> = < deque> .popleft()
1277
+ ```
1278
+
1279
+ ``` python
1277
1280
< deque> .extendleft(< collection> ) # Collection gets reversed.
1278
1281
< deque> .rotate(n = 1 ) # Rotates elements to the right.
1279
1282
```
0 commit comments