Created
November 11, 2021 15:10
-
-
Save eneshazr/66211574a8de67d4cafb51087d13b9f3 to your computer and use it in GitHub Desktop.
Python ile boşluksuz metinden kelime bulma
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
# Finding words from text without spaces with Python. | |
def kelimeBul(kelime, find): | |
s = 0 | |
yeni = [] | |
for i in kelime: | |
if ("".join(yeni) == find): | |
break | |
elif find[s] == i: | |
# print(find[s], i) | |
yeni.append(i) | |
s += 1 | |
else: | |
s = 0 | |
yeni.clear() | |
print("".join(yeni)) | |
kelime = "yazilimfuryasi.com" | |
find = "furya" | |
kelimeBul(kelime, find) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment