#f = open("myfile txt", "x") #f = open("myfile txt", "w")


Download 13.17 Kb.
Sana22.02.2023
Hajmi13.17 Kb.
#1219730
Bog'liq
1-labaratoriya


#f = open("myfile.txt", "x")
#f = open("myfile.txt", "w")
#f.write("son Farangiz Olma kompyuter Professor talaba Telefon kurtka son MAC soat parda sumka sichqoncha tufli son Olma")
#f.close()
#f = open("myfile.txt", "r")
#print(f.read())
word = "son"
count = 0
with open("myfile.txt", 'r') as f:
for line in f:
words = line.split()
for i in words:
if(i==word):
count=count+1
print("Takrorlangan so`z", word, "=>", count)

Download 13.17 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling