Skip to content

Typo in logging example missing an expected bug #496

@gavgav7

Description

@gavgav7

On section https://github.com/wilfredinni/python-cheatsheet/blob/master/docs/cheatsheet/debugging.md#logging

The text advises there is a bug in the following code and encourages the reader to execute the code to see how the logging functionality works, however when run, the script executes perfectly, and the debug messages confirm that. It appears the only bug in the code is that there isn't a bug.

I suspect when writing up this page, someone inadvertently 'corrected' the code before submitting it.

The nearest solution I could find to replicate the debug messages was changing:

for i in range(1, n + 1):

to

for i in range(0, n + 1):

or completely removing the 0 as a likely real-world scenario:

for i in range(n + 1):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions