Created
July 12, 2021 06:19
-
-
Save ceaksan/e3818ea47622348a8c50d05c4c489387 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
txt = '''Yaşamak görevdir bu yangın yerinde | |
Yaşamak, insan kalarak''' | |
''' | |
FIND METODU | |
''' | |
print(txt.find('Yaşamak')) # 0 | |
print(txt.find('Sivas')) # -1 | |
print(txt.find('yangın')) # 20 | |
print(txt.find('Yangın')) # -1 | |
print(txt.find('Yaşamak', 1)) # 35 | |
# Çünkü, 'aşamak' ile eşleşmeyecektir. | |
# bkz. txt[1:] | |
print(txt.find('Yaşamak', 8)) # 35 | |
# bkz. txt[8:] | |
print(txt.find('Yaşamak', 36, 50)) # -1 | |
# bkz. txt[36:50] | |
print(txt.find('insan', 36, 50)) # 44 | |
# bkz. txt[36:50] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment