Skip to content

Conversation

slackuj
Copy link

@slackuj slackuj commented Oct 7, 2024

f100 doesn't writes the result.We need to use print(f100) to write the result.


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

f100 doesn't writes the result.We need to use print(f100) to write the result.
@ghost
Copy link

ghost commented Oct 7, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news awaiting review labels Oct 7, 2024
@skirpichev
Copy link
Contributor

f100 doesn't writes the result.

Why do you think so?! You should run examples in the interactive interpreter.

>>> def fib2(n):
...     result = []
...     a, b = 0, 1
...     while a < n:
...         result.append(a)
...         a, b = b, a+b
...     return result
...     
>>> f100 = fib2(100)
>>> f100
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]

@skirpichev skirpichev closed this Oct 7, 2024
@skirpichev
Copy link
Contributor

@slackuj, I would suggest you next time - first ask for help in https://discuss.python.org/c/help/7. Just in case you miss something.

Of course if you are absolutely sure that have found a bug, feel free to report it here: https://github.com/python/cpython/issues

@slackuj
Copy link
Author

slackuj commented Oct 7, 2024

f100 doesn't writes the result.

Why do you think so?! You should run examples in the interactive interpreter.

>>> def fib2(n):
...     result = []
...     a, b = 0, 1
...     while a < n:
...         result.append(a)
...         a, b = b, a+b
...     return result
...     
>>> f100 = fib2(100)
>>> f100
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]

Sorry, I was not using the interactive interpreter!? .

@skirpichev
Copy link
Contributor

It happens.

Keep in mind, that error in the CPython Tutorial - a very severe issue. That's why it's a good idea - first ask for help in forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants