-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
TommyUnreal
wants to merge
17
commits into
python:main
from
TommyUnreal:107017_tutorial_introduction_assumtions_removal_fibonacci
Closed
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2383c73
Draft. Rework ´the Fibonacci example.
TommyUnreal f1cd228
Proofread, fixed the PEP 8, doctest.
TommyUnreal 4f8e940
Fix rst formatting and missing literal block
TommyUnreal 2584707
Fix inline literal.
TommyUnreal 1fae12b
Better multichar end arg example in print().
TommyUnreal e87530d
Fix review hints. Explain condition better.
TommyUnreal 10107c1
Fix inline literals.
TommyUnreal cdafb1f
Update Doc/tutorial/introduction.rst
TommyUnreal 3c9bec8
Update Doc/tutorial/introduction.rst
TommyUnreal 6ad0175
Update Doc/tutorial/introduction.rst
TommyUnreal 7722165
Fix multiple assignment example.
TommyUnreal 3c0171e
Corrected grammar errors.
TommyUnreal fbb36a0
Better wording in example comment.
TommyUnreal d9a707d
Fixed typo, improved wording.
TommyUnreal 7e627a4
Fixed missing-space-before-role lint error.
TommyUnreal 33a3b3c
fIXED WARNING: Title underline too short lint.
TommyUnreal 0f51c49
Merge branch 'main' into 107017_tutorial_introduction_assumtions_remo…
hugovk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix inline literals.
- Loading branch information
commit 10107c1ffd6e477a65d18b2b2cc3ad714f18bee9
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 | ||||||
condition will be ``False``:: | ||||||
|
||||||
>>> count = 0; # define variable to which we will be adding 1 in a loop | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
>>> 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. | ||||||
|
@@ -562,7 +562,7 @@ Function argumets | |||||
|
||||||
We already know :func:`print` function, that writes the value of the | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already know the print function ?
TommyUnreal marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
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:: | ||||||
|
||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.