We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96fb844 commit fce2118Copy full SHA for fce2118
1 file changed
ultimatepython/syntax/function.py
@@ -33,6 +33,16 @@ def sum_until(fn, n):
33
return total
34
35
36
+def without_parameters():
37
+ """A function that does not accept parameters and does not return a value."""
38
+ pass
39
+
40
41
+def sum(x: int, y: int) -> int:
42
+ """A function that accepts parameters and has type hints."""
43
+ return x + y
44
45
46
def main():
47
# The `add` function can be used for numbers as expected
48
add_result_int = add(1, 2)
@@ -54,6 +64,10 @@ def main():
54
64
# attribute! Remember this - everything in Python is an object
55
65
assert "includes this docstring!" in sum_until.__doc__
56
66
67
+ # Call a few more functions to show that they are valid
68
+ assert without_parameters() is None
69
+ assert sum(1, 2) == 3
70
57
71
58
72
if __name__ == "__main__":
59
73
main()
0 commit comments