Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## file two
- ## nomber 3.4
- file_in = open("input.txt", "r")
- file_out = open("output.txt", "w")
- word = input().lower() #читаем с консоли слово и переводим в нижний регистр
- cnt_str = 1 #счетчик строк
- for line in file_in :
- line = line.lower()
- line = line.split()
- cnt_clm = 1 #счетчик позиции в строке. Нумерация с единицы.
- for el in line :
- if word == el : #если искомое слово равно слову из файла то выводим координаты
- file_out.write(str(cnt_str) + " " + str(cnt_clm) + "\n")
- cnt_clm += 1
- cnt_str += 1
- file_out.close()
- file_in.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement