Skip to content

Instantly share code, notes, and snippets.

View SyamSundarN's full-sized avatar

NALLAMEKALA SYAM SUNDAR SyamSundarN

View GitHub Profile
@solen003
solen003 / word_count_sort_dictionary
Created July 18, 2018 09:43
Write a program to compute the frequency of the words from the input. The output should output after sorting the key alphanumerically. Suppose the following input is supplied to the program: New to Python or choosing between Python 2 and Python 3? Read Python 2 or Python 3. Then, the output should be: 2:2 3.:1 3?:1 New:1 Python:5 Read:1 and:1 be…
import operator
text_line = input("Type in: ")
freq_dict = {}
for i in text_line.split(' '):
if i.isalpha():
if i not in freq_dict:
freq_dict[i] = 1