8000 gh-107017: Rework the Fibonacci example by TommyUnreal · Pull Request #107132 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-107017: Rework th 8000 e Fibonacci example #107132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix inline literals.
  • Loading branch information
TommyUnreal committed Jul 29, 2023
commit 10107c1ffd6e477a65d18b2b2cc3ad714f18bee9
10 changes: 5 additions & 5 deletions Doc/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -528,18 +528,18 @@ In Python, the following comparison operators are used:

Let's create a simple loop. We need the keyword ``while`` and a condition;
in this case, ``count < 5``. To ensure that the loop finishes, we must make
sure that the condition is `not fulfilled` at a certain step. Otherwise, the
sure that the condition is *not fulfilled* at a certain step. Otherwise, the
code would repeat indefinitely. To achieve that, we can increase the value
of count. As soon as the variable count reaches the value 5, the condition
will be ``False``::
of count. As soon as the variable ``count`` reaches the value 5, the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
of count. As soon as the variable ``count`` reaches the value 5, the
of ``count``. As soon as the variable ``count`` reaches the value 5, the

condition will be ``False``::

>>> count = 0; # define variable to which we will be adding 1 in a loop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
>>> count = 0; # define variable to which we will be adding 1 in a loop
>>> count = 0 # define variable to which we will be adding 1 in a loop

>>> while count < 5: count = count + 1 # hit enter one more time to start the loop
...
>>> count # when count reached value of 5, while loop finished
5

Note that block inside the `while` loop, or *body* of the loop is *indented*.
Note that block inside the ``while`` loop, or *body* of the loop is *indented*.
Indentation is Python's way of grouping statements together. When you use
the Python shell, you need to type a tab or space(s) for each indented line.
Each line within a block must be indented by the same amount.
Expand All @@ -562,7 +562,7 @@ Function argumets

We already know :func:`print` function, that writes the value of the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already know the print function ?

argument(s) it receives on screen. The arguments are enclosed within
parentheses ``()``. In simplest form, like ``print(a, b)`` the arguments
parentheses ``()``. In simplest form, like ``print(a, b)``, the arguments
are positional, meaning the function processes them in the same order
as they are written::

Expand Down
0