Skip to content

Commit

Permalink
Fixes typo
Browse files Browse the repository at this point in the history
Thank you Akshay Kataria for finding this typo.
  • Loading branch information
kushaldas committed Mar 19, 2023
1 parent 0174180 commit 807fd27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions docs/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ parameter.

::

>>> def hello(*, name='User'):
>>> def hello(*, name: str ='User'):
... print("Hello %s" % name)
...
>>> hello('Kushal')
Expand All @@ -311,7 +311,7 @@ From Python3.8, we can also mark any function to have only positional arguments.

::

>>> def add(a, b, /):
>>> def add(a: int, b: int, /):
... return a + b
...
>>> add(2, 3)
Expand All @@ -338,7 +338,7 @@ the docstring for a function called *longest_side*.
#!/usr/bin/env python3
import math

def longest_side(a, b):
def longest_side(a: int, b: int):
"""
Function to find the length of the longest side of a right triangle.

Expand Down Expand Up @@ -382,7 +382,7 @@ returns another function to add 5 to the given argument.
::

def givemefive():
def add5(x):
def add5(x: int) -> int:
return x + 5
return add5

Expand Down Expand Up @@ -430,7 +430,7 @@ iterator and returns an iterator.
Example::

>>> lst = [1, 2, 3, 4, 5]
>>> def square(num):
>>> def square(num: int) -> int:
... "Returns the square of a given number."
... return num * num
...
Expand Down
2 changes: 1 addition & 1 deletion docs/thebeginning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ used vi. You can even use GUI based tools like `Kate
<https://kate-editor.org/get-it/>`_ or `gedit
<https://wiki.gnome.org/Apps/Gedit>`_. In the later part of the book, I will help you to use a few different editors.

Open a shell or terinal and perform these steps.
Open a shell or terminal and perform these steps.

1. Enter the following text:

Expand Down

0 comments on commit 807fd27

Please sign in to comment.