GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-107017: Rework the Fibonacci example by TommyUnreal · Pull Request #107132 · python/cpython

Conversation

@TommyUnreal

@TommyUnreal TommyUnreal commented Jul 23, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Rework the example to be simple to follow and also the concepts needed for that are now explained one by one with their own shorter examples.

Needs proofread. Please comment with your ideas for improvement.

  • Issue: remove the assumptions from The tutorial #107017

📚 Documentation preview 📚: https://cpython-previews--107132.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@TommyUnreal
Draft. Rework ´the Fibonacci example.
2383c73
Rework the example to be simple to follow and also the concepts needed
for that are now explained one by one with their own shorter examples.
@bedevere-bot bedevere-bot added the awaiting review label Jul 23, 2023
@bedevere-bot bedevere-bot mentioned this pull request Jul 23, 2023
remove the assumptions from The tutorial #107017
Closed
@bedevere-bot bedevere-bot added docs Documentation in the Doc dir skip news labels Jul 23, 2023
@TommyUnreal
TommyUnreal marked this pull request as draft July 23, 2023 14:15
@bedevere-bot bedevere-bot removed the awaiting review label Jul 23, 2023
hugovk
hugovk reviewed Jul 23, 2023
View reviewed changes
Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal added 4 commits July 23, 2023 23:10
@TommyUnreal
Proofread, fixed the PEP 8, doctest.
f1cd228
@TommyUnreal
Fix rst formatting and missing literal block
4f8e940
@TommyUnreal
Fix inline literal.
2584707
@TommyUnreal
Better multichar end arg example in print().
1fae12b
@TommyUnreal
TommyUnreal marked this pull request as ready for review July 23, 2023 21:53
@bedevere-bot bedevere-bot added the awaiting review label Jul 23, 2023
evildmp
evildmp suggested changes Jul 26, 2023
View reviewed changes
Comment thread Doc/tutorial/introduction.rst Outdated

A *multiple assignment* of variables us allows to set values of more than one
variable on a single line. Notice that if the value assignment is a
expression, it is first evaluated and then assigned.::

@evildmp evildmp Jul 26, 2023

Copy link
Copy Markdown
Contributor

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.

.:: will produce a full-stop and a colon:

.:

One or the other. I suggest losing the full-stop.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Doc/tutorial/introduction.rst Outdated
------------------

The :keyword:`while` loop is example of a repeating cycle. It performs
a block of code over as long as the condition (in example: ``a < 10``) is

@evildmp evildmp Jul 26, 2023

Copy link
Copy Markdown
Contributor

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.

"in example" > "for example"

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TommyUnreal TommyUnreal Jul 29, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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.

What I wanted to say is that "in the example below the condition is the following expression a < 10", but that is no longer present in the examples. I will rework that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst Outdated
>>> 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*.

@evildmp evildmp Jul 26, 2023

Copy link
Copy Markdown
Contributor

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.

I suggest using while, to draw attention to it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Doc/tutorial/introduction.rst Outdated
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.
When we want to exit the indented block of code in the Python shell, we must
follow it by a blank line to indicate its completion. This way, parser knows

@evildmp evildmp Jul 26, 2023

Copy link
Copy Markdown
Contributor

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.

"... the parser"

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Doc/tutorial/introduction.rst Outdated
Each line within a block must be indented by the same amount.
When we want to exit the indented block of code in the Python shell, we must
follow it by a blank line to indicate its completion. This way, parser knows
we have finished typing the last line).::

@evildmp evildmp Jul 26, 2023

Copy link
Copy Markdown
Contributor

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.

Again, here we have a full-stop and a colon in the output.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Doc/tutorial/introduction.rst
... print(count, end=' ') # end the output of print() with a whitespace
... count = count - 1 # lower the value by one with each repetition
...
10 9 8 7 6

@evildmp evildmp Jul 26, 2023

Copy link
Copy Markdown
Contributor

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.

This is an elegant touch.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal reacted with rocket emoji
All reactions
  • 🚀 1 reaction

@TommyUnreal TommyUnreal Jul 29, 2023

Copy link
Copy Markdown
Contributor Author

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.

Thank you :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst
... print('', a, '', end='->')
... a, b = b, a+b
...
0 -> 1 -> 1 -> 2 -> 3 -> 5 -> 8 -> 13 -> 21 -> 34 -> 55 -> 89 -> 144 ->

@evildmp evildmp Jul 26, 2023

Copy link
Copy Markdown
Contributor

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.

And I like the way that the example illustrates the value of using end - no need to explain, the example does it much more effectively. This will stick in someone's mind.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Jul 26, 2023
@hugovk hugovk added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Jul 29, 2023
TommyUnreal added 2 commits July 29, 2023 09:09
@TommyUnreal
Fix review hints. Explain condition better.
e87530d
Fix parts where a paragraph ended both with full-stop and colon.
Added new paragraph, where example of simple loop is explained in
detail. Plus warning about indefinite loops.
@TommyUnreal
Fix inline literals.
10107c1
@TommyUnreal
TommyUnreal requested review from evildmp and hugovk July 29, 2023 07:37
CaedenPH
CaedenPH reviewed Jul 29, 2023
View reviewed changes
Comment thread Doc/tutorial/introduction.rst

>>> a, b = 0, 1
>>> while a < 150:
... print('', a, '', end='->')

@CaedenPH CaedenPH Jul 29, 2023

Copy link
Copy Markdown

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.

I understand that this utilities the print sep param, however this is nor explained nor inferred, so to a beginner it may be confusing

Perhaps it could be beneficial to show off f-strings like

Suggested change
... print('', a, '', end='->')
... print(f'{a} ->', end='')

Or to keep end as ->

Suggested change
... print('', a, '', end='->')
... print(f'{a} ', end="->")

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@evildmp evildmp Jul 29, 2023

Copy link
Copy Markdown
Contributor

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.

I very strongly prefer the original print('', a, '', end='->'), which reduces the punctuation the learner has to deal with to a minimum, and emphasises instead the connection between more easily assimilated things, like the English word "end" and the "arrow" ("->").

Showing off f-strings while demonstrating a different functionality introduces unnecessary cognitive burden. Two different kinds of quotes and two different kinds of brackets requires a lot of parsing and stopping. I don't think this is the right solution here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal reacted with rocket emoji
All reactions
  • 🚀 1 reaction

@TommyUnreal TommyUnreal Jul 29, 2023

Copy link
Copy Markdown
Contributor Author

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.

My reasoning: As this is an Introduction chapter, I wanted to keep the number of introduced concepts to the minimum. There are ways to code this better, but it is not formally wrong. The default separator is already shown in the example above and this just builds on that, so it's hopefully not confusing to the reader.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

CaedenPH reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/tutorial/introduction.rst Outdated
>>> count = 10
>>> while count > 5:
... print(count, end=' ') # end the output of print() with a whitespace
... count = count - 1 # lower the value by one with each repetition

@CaedenPH CaedenPH Jul 29, 2023

Copy link
Copy Markdown

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.

Suggested change
... count = count - 1 # lower the value by one with each repetition
... count = count - 1 # decrement the value each iteration

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@evildmp evildmp Jul 29, 2023

Copy link
Copy Markdown
Contributor

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.

I would strongly prefer "decrease the value by one".

The reason is that many people will not be familiar with the word "decrement", it's used very little in English outside technical contexts.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

CaedenPH reacted with thumbs up emoji TommyUnreal reacted with rocket emoji
All reactions
  • 👍 1 reaction
  • 🚀 1 reaction
Comment thread Doc/tutorial/introduction.rst Outdated

>>> a, b = 1, 5 # multiple assignment of two variables
>>> a
0

@CaedenPH CaedenPH Jul 29, 2023

Copy link
Copy Markdown

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.

Needs to be 1
image

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@TommyUnreal TommyUnreal Jul 29, 2023

Copy link
Copy Markdown
Contributor Author

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.

Is this a doctest bug?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal and others added 3 commits July 29, 2023 09:52
@TommyUnreal @CaedenPH
Update Doc/tutorial/introduction.rst
cdafb1f
Co-authored-by: Caeden Perelli-Harris <[email protected]>
@TommyUnreal @CaedenPH
Update Doc/tutorial/introduction.rst
3c9bec8
Co-authored-by: Caeden Perelli-Harris <[email protected]>
@TommyUnreal @CaedenPH
Update Doc/tutorial/introduction.rst
6ad0175
More precise and clearer wording.

Co-authored-by: Caeden Perelli-Harris <[email protected]>
evildmp
evildmp approved these changes Jul 29, 2023
View reviewed changes
Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/tutorial/introduction.rst Outdated
>>> count = 10
>>> while count > 5:
... print(count, end=' ') # end the output of print() with a whitespace
... count = count - 1 # lower the value by one with each repetition

@evildmp evildmp Jul 29, 2023

Copy link
Copy Markdown
Contributor

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.

I would strongly prefer "decrease the value by one".

The reason is that many people will not be familiar with the word "decrement", it's used very little in English outside technical contexts.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

CaedenPH reacted with thumbs up emoji TommyUnreal reacted with rocket emoji
All reactions
  • 👍 1 reaction
  • 🚀 1 reaction
Comment thread Doc/tutorial/introduction.rst

>>> a, b = 0, 1
>>> while a < 150:
... print('', a, '', end='->')

@evildmp evildmp Jul 29, 2023

Copy link
Copy Markdown
Contributor

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.

I very strongly prefer the original print('', a, '', end='->'), which reduces the punctuation the learner has to deal with to a minimum, and emphasises instead the connection between more easily assimilated things, like the English word "end" and the "arrow" ("->").

Showing off f-strings while demonstrating a different functionality introduces unnecessary cognitive burden. Two different kinds of quotes and two different kinds of brackets requires a lot of parsing and stopping. I don't think this is the right solution here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@TommyUnreal
Fix multiple assignment example.
7722165
CaedenPH
CaedenPH approved these changes Jul 29, 2023
View reviewed changes

@CaedenPH CaedenPH left a comment

Copy link
Copy Markdown

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.

Other than these grammatical mistakes, looks like a good change to me

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal and others added 2 commits July 29, 2023 12:10
@TommyUnreal @CaedenPH
Corrected grammar errors.
3c0171e
Co-authored-by: Caeden Perelli-Harris <[email protected]>
@TommyUnreal
Better wording in example comment.
fbb36a0
lower the value -> decrease the value
SylvainDe
SylvainDe reviewed Aug 22, 2023
View reviewed changes

@SylvainDe SylvainDe left a comment

Copy link
Copy Markdown
Contributor

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.

Very nice touch! Here are 2 cosmetic details

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst Outdated
0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,
4

Function argumets

@SylvainDe SylvainDe Aug 22, 2023

Copy link
Copy Markdown
Contributor

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.

Typo here

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst Outdated
Function argumets
-----------------

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

@SylvainDe SylvainDe Aug 22, 2023

Copy link
Copy Markdown
Contributor

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.

We already know the print function ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
TommyUnreal
TommyUnreal commented Aug 22, 2023
View reviewed changes
Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal
TommyUnreal commented Aug 22, 2023
View reviewed changes
Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@TommyUnreal
Fixed typo, improved wording.
d9a707d
TommyUnreal
TommyUnreal commented Aug 22, 2023
View reviewed changes
Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@TommyUnreal
Fixed missing-space-before-role lint error.
7e627a4
TommyUnreal
TommyUnreal commented Aug 22, 2023
View reviewed changes
Comment thread Doc/tutorial/introduction.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

TommyUnreal and others added 2 commits August 23, 2023 00:19
@TommyUnreal
fIXED WARNING: Title underline too short lint.
33a3b3c
@hugovk
Merge branch 'main' into 107017_tutorial_introduction_assumtions_remo…
0f51c49
…val_fibonacci
hugovk
hugovk reviewed Aug 23, 2023
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

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.

A suggestion and some little wording things, otherwise looks good!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst
We can use Python for more complex tasks than adding two and two together.
For instance, we can compute the numbers of the
`Fibonacci series <https://en.wikipedia.org/wiki/Fibonacci_number>`_.
To do that we need to utilize three following concepts.

@hugovk hugovk Aug 23, 2023

Copy link
Copy Markdown
Member

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.

Suggested change
To do that we need to utilize three following concepts.
To do that we need to use the three following concepts.

Let's use the plain English "use" instead of "utilize".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst
Multiple Assignment
-------------------

A *multiple assignment* of variables us allows to set values of more than one

@hugovk hugovk Aug 23, 2023

Copy link
Copy Markdown
Member

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.

Suggested change
A *multiple assignment* of variables us allows to set values of more than one
A *multiple assignment* of variables us allows to set the values of more than one

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst
-------------------

A *multiple assignment* of variables us allows to set values of more than one
variable on a single line. Notice that if the value assignment is a

@hugovk hugovk Aug 23, 2023

Copy link
Copy Markdown
Member

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.

Suggested change
variable on a single line. Notice that if the value assignment is a
variable on a single line. Notice that if the value assignment is an

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst
Repeating our code
------------------

The :keyword:`while` loop is example of a repeating cycle. It performs

@hugovk hugovk Aug 23, 2023

Copy link
Copy Markdown
Member

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.

Suggested change
The :keyword:`while` loop is example of a repeating cycle. It performs
The :keyword:`while` loop is an example of a repeating cycle. It performs

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst
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
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

@hugovk hugovk Aug 23, 2023

Copy link
Copy Markdown
Member

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst
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

@hugovk hugovk Aug 23, 2023

Copy link
Copy Markdown
Member

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst
Comment on lines +537 to +542
>>> 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*.

@hugovk hugovk Aug 23, 2023

Copy link
Copy Markdown
Member

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.

The example above uses a one-liner: while count < 5: count = count + 1

Let's use indentation in the example, to match the text. Something like this?

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*.
>>> 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*.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/tutorial/introduction.rst
Comment on lines +565 to +566
parentheses ``()``. In simplest form, like ``print(a, b)``, the arguments
are positional, meaning the function processes them in the same order

@hugovk hugovk Aug 23, 2023

Copy link
Copy Markdown
Member

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.

Suggested change
parentheses ``()``. In simplest form, like ``print(a, b)``, the arguments
are positional, meaning the function processes them in the same order
parentheses ``()``. In its simplest form, like ``print(a, b)``, the arguments
are positional, meaning the function processes them in the same order

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hauntsaninja

hauntsaninja commented Sep 7, 2023

Copy link
Copy Markdown
Contributor

Thanks for working on this! As compared to the version on the left hand side, I found presenting all the concepts up front in detailed sections a little intimidating. I preferred seeing the four lines we're building towards first, and then an explanation of what's going on.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 only security fixes and removed needs backport to 3.11 only security fixes labels May 9, 2024
@willingc willingc added awaiting changes and removed awaiting core review labels Nov 4, 2024
@hugovk hugovk removed the needs backport to 3.12 only security fixes label Apr 10, 2025
@hugovk hugovk changed the title gh-107017: Rework the Fibonacci example. gh-107017: Rework the Fibonacci example Apr 10, 2025
@python-cla-bot

python-cla-bot Bot commented Apr 18, 2025

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

  • [email protected]

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hauntsaninja hauntsaninja closed this May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk left review comments
+3 more reviewers
@SylvainDe SylvainDe SylvainDe left review comments
@evildmp evildmp evildmp approved these changes
@CaedenPH CaedenPH CaedenPH approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting changes docs Documentation in the Doc dir needs backport to 3.13 only security fixes skip news

Projects

Docs PRs
Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@TommyUnreal @hauntsaninja @evildmp @SylvainDe @hugovk @CaedenPH @willingc @serhiy-storchaka @bedevere-bot
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.