Sagot :
Cevap:
metin=input("metin giriniz :")
k=input("aranacak harfi giriniz :")
say=0
s=0
for x in metin:
if x==k:
print(str(s))
say=say+1
s=s+1
if say>0:
print(str(say)+ " adet harf içerir")
else:
print(k + " harfi hiç yoktur")
python dilinde yazdım
Açıklama:
# Python 3
def function():
text = input("text : ")
target = input("letter : ")
count = text.count(target)
length = len(text)
indexes = []
for index in range(length):
letter = text[index]
if letter == target:
indexes.append(index)
print(f"indexes : {indexes}")
print(f"count : {count}")
function()
Thank you for visiting our website wich cover about Bilgisayar. We hope the information provided has been useful to you. Feel free to contact us if you have any questions or need further assistance. See you next time and dont miss to bookmark.