Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- in_file = open("tekst.txt", "r")
- out_file = open("formatiranje.txt", "w")
- string_text = in_file.read().split()
- count = 0
- for word in string_text:
- if "." in word or "!" in word or "?" in word:
- out_file.write(word + "\n")
- count += 1
- else:
- out_file.write(word + " ")
- in_file.close()
- out_file.close()
- print "Broj rečenica je:", count
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement