From b3c180219f9b0e7f59869c16e988dc29465fdfd3 Mon Sep 17 00:00:00 2001 From: kioan Date: Sun, 15 Aug 2021 12:33:34 +0300 Subject: [PATCH] Update 04_strings.md Fixed the results on find and rfind examples --- 04_Day_Strings/04_strings.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/04_Day_Strings/04_strings.md b/04_Day_Strings/04_strings.md index 4377d5eba..0a7840d15 100644 --- a/04_Day_Strings/04_strings.md +++ b/04_Day_Strings/04_strings.md @@ -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