This file contains hidden or 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
file_name = input() | |
fin = open(file_name, 'r') | |
text = fin.readlines() | |
dictionary = {} | |
for str in text: | |
for word in str.split(): | |
try: | |
dictionary[word] = dictionary[word] +1 | |
except KeyError: | |
dictionary[word] = 1 |
This file contains hidden or 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
s = input() | |
print (len( set( s.split()))) |