Skip to content

fix: correct index() examples and section order in Day 4#800

Open
Revati-N wants to merge 1 commit intoAsabeneh:masterfrom
Revati-N:add-day4
Open

fix: correct index() examples and section order in Day 4#800
Revati-N wants to merge 1 commit intoAsabeneh:masterfrom
Revati-N:add-day4

Conversation

@Revati-N
Copy link
Copy Markdown

Fixes #796

Changes made

day_4.py

  • Fixed the index() section (around line 136) which was incorrectly using .find() instead of .index()
  • Fixed the isdecimal() section which had leftover .find() calls instead of actual isdecimal() examples

04_strings.md

  • Moved the ### Escape Sequences in Strings section to appear after #### Unpacking Characters, so the doc order matches the .py file
  • Updated the Table of Contents to reflect the new section order

Why

A beginner following the .py file in the terminal and cross-referencing the .md doc would see escape sequences before indexing in the doc, but indexing before escape sequences in the code — causing confusion. The .index() section was also silently demonstrating .find() behavior instead.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Another Day 4 Issue

1 participant