Skip to content

Duplicate/mislabeled isdecimal() section #924

Description

@bravefe

Duplicate/mislabeled isdecimal() section

File

30-Days-Of-Python/04_Day_Strings/day_4.py

Description

There's a duplicate and incorrectly labeled isdecimal() section at line 162. It's actually showing find() examples, not isdecimal().

Current content at line 162

# isdecimal(): Checks Decimal Characters

challenge = 'thirty days of python'
print(challenge.find('y'))  # 5
print(challenge.find('th'))  # 0

Why this is a problem

  1. This section is labeled isdecimal() but demonstrates the find() method instead.
  2. find() is already correctly demonstrated earlier, at line 115:
# find(): Returns the index of first occurrence of substring

challenge = 'thirty days of python'
print(challenge.find('y'))  # 5
print(challenge.find('th'))  # 0
  1. The correct isdecimal() example already exists at line 175:
# isdecimal(): Checks decimal characters

num = '10'
print(num.isdecimal())  # True
num = '10.5'
print(num.isdecimal())  # False

Requested change

Could someone remove the duplicate, mislabeled isdecimal() section at line 162? Since find() is already demonstrated at line 115 and the correct isdecimal() example remains at line 175, this section is redundant and should just be deleted to keep each string method example in its appropriate place.

Activity

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

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