You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-11Lines changed: 40 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,24 +4,53 @@ Following project contains [Python3](https://docs.python.org/3/) implementation
4
4
### Format of the Programs :
5
5
```
6
6
1. # <link reffering to the respective GeeksforGeeks page>
7
-
2. <Data Structures used, if any>
8
-
3. <Function handling the computation>
7
+
2. <from module import module | if any>
8
+
3. <Data Structures used | if any>
9
+
4. <Primary Function : handles the computation>
9
10
: return the desired result (whenever possible)
10
-
4. <Helper functions, if any>
11
-
5. # main
12
-
6. if __name__=="__main__" :
13
-
7. <inside main>
11
+
5. <Helper functions | if any>
12
+
6. # main
13
+
7. if __name__=="__main__" :
14
+
8. <inside main>
14
15
: get input from the user
15
-
: pre-processing of data, if required
16
+
: pre-processing of data | if required
16
17
: call the function
17
18
: print the result
18
-
8. Documentation for the code
19
+
9. Documentation for the code
19
20
: Input Explanation
20
21
: Input <Example>
21
22
: Output <Example>
22
-
9. Documentation for the GeeksforGeeks page content
23
+
10. Documentation for the GeeksforGeeks page content
23
24
```
24
25
25
-
**Note**: this is not affiliated with GeeksforGeeks in any way other than for reference purpose.
26
+
**Imp :**In the code, provide [Function Annotations](https://www.python.org/dev/peps/pep-3107/) as per [PEP 3107 -- Function Annotations](https://www.python.org/dev/peps/pep-3107/)**for every parameter passed in a function**. Return type specification is optional.
26
27
27
-
**Also Note** : the code implemetation (and sometimes even algorithm) might be different than the one in GeeksforGeeks. The decision is upon the author and author alone. New Algorithms for the same problem statement may be added in the future.
28
+
Annotations for *parameters* take the form of optional expressions that follow the parameter name:
29
+
30
+
```python
31
+
deffoo(a: expression, b: expression =5):
32
+
...
33
+
34
+
#Ex :
35
+
deffoo(l: list, s: str='xyz'):
36
+
...
37
+
38
+
#In pseudo-grammar, parameters now look like identifier [: expression] [= expression]
39
+
```
40
+
41
+
Annotations for the type of a function's return value take the form of optional expressions that is done like so:
42
+
43
+
```python
44
+
defsum() -> expression:
45
+
...
46
+
47
+
#Ex :
48
+
defsum() -> int:
49
+
...
50
+
51
+
```
52
+
53
+
54
+
##### **Note** : this is not affiliated with GeeksforGeeks in any way other than for reference purpose.
55
+
56
+
##### **Also Note** : the code implemetation (and sometimes even algorithm) might be different than the one in GeeksforGeeks. The decision is upon the author and author alone. New Algorithms for the same problem statement may be added in the future.
0 commit comments