Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 04_Day_Strings/04_strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,16 +328,16 @@ print(challenge.expandtabs(10)) # 'thirty days of python'

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

- rfind(): Returns the index of the last occurrence of a substring, if not found returns -1

```py
challenge = 'thirty days of python'
print(challenge.rfind('y')) # 5
print(challenge.rfind('th')) # 1
print(challenge.rfind('y')) # 16
print(challenge.rfind('th')) # 17
```

- format(): formats string into a nicer output
Expand Down