import pprint
import itertools
message1=open(r'Downloads/[Link]')
message=[Link]()
[Link]()
print('the content in the file is:\n\n',message)
count={}
for character in [Link]():
[Link](character,0)
count[character]=count[character]+1
print('frequency of words appeared in the semetence')
[Link](count)
sortedcount=sorted([Link](),key=lambda x:x[1],reverse=True)
converttodict=dict(sortedcount)
print('sorted in descending order:\n\n',converttodict)
sliceddict=dict([Link]([Link](),10))
print('10 most frequently appered word in a paragraph:\n\n',sliceddict)
Output
the content in the file is:
Bluetooth technology is a high speed low powered wireless technology that is used to
trnsmit and recieve data serially.
frequency of words appeared in the semetence
{'Bluetooth': 1}
sorted in descending order:
{'Bluetooth': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1, 'technology': 1}
sorted in descending order:
{'Bluetooth': 1, 'technology': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1, 'is': 1, 'technology': 1}
sorted in descending order:
{'Bluetooth': 1, 'technology': 1, 'is': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1, 'a': 1, 'is': 1, 'technology': 1}
sorted in descending order:
{'Bluetooth': 1, 'technology': 1, 'is': 1, 'a': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1, 'a': 1, 'high': 1, 'is': 1, 'technology': 1}
sorted in descending order:
{'Bluetooth': 1, 'technology': 1, 'is': 1, 'a': 1, 'high': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1, 'a': 1, 'high': 1, 'is': 1, 'speed': 1, 'technology': 1}
sorted in descending order:
{'Bluetooth': 1, 'technology': 1, 'is': 1, 'a': 1, 'high': 1, 'speed': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1,
'a': 1,
'high': 1,
'is': 1,
'low': 1,
'speed': 1,
'technology': 1}
sorted in descending order:
{'Bluetooth': 1, 'technology': 1, 'is': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1,
'a': 1,
'high': 1,
'is': 1,
'low': 1,
'powered': 1,
'speed': 1,
'technology': 1}
sorted in descending order:
{'Bluetooth': 1, 'technology': 1, 'is': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1,
'powered': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1,
'a': 1,
'high': 1,
'is': 1,
'low': 1,
'powered': 1,
'speed': 1,
'technology': 1,
'wireless': 1}
sorted in descending order:
{'Bluetooth': 1, 'technology': 1, 'is': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1,
'powered': 1, 'wireless': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1,
'a': 1,
'high': 1,
'is': 1,
'low': 1,
'powered': 1,
'speed': 1,
'technology': 2,
'wireless': 1}
sorted in descending order:
{'technology': 2, 'Bluetooth': 1, 'is': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1,
'powered': 1, 'wireless': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1,
'a': 1,
'high': 1,
'is': 1,
'low': 1,
'powered': 1,
'speed': 1,
'technology': 2,
'that': 1,
'wireless': 1}
sorted in descending order:
{'technology': 2, 'Bluetooth': 1, 'is': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1,
'powered': 1, 'wireless': 1, 'that': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1,
'a': 1,
'high': 1,
'is': 2,
'low': 1,
'powered': 1,
'speed': 1,
'technology': 2,
'that': 1,
'wireless': 1}
sorted in descending order:
{'technology': 2, 'is': 2, 'Bluetooth': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1,
'powered': 1, 'wireless': 1, 'that': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1,
'a': 1,
'high': 1,
'is': 2,
'low': 1,
'powered': 1,
'speed': 1,
'technology': 2,
'that': 1,
'used': 1,
'wireless': 1}
sorted in descending order:
{'technology': 2, 'is': 2, 'Bluetooth': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1,
'powered': 1, 'wireless': 1, 'that': 1, 'used': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1,
'a': 1,
'high': 1,
'is': 2,
'low': 1,
'powered': 1,
'speed': 1,
'technology': 2,
'that': 1,
'to': 1,
'used': 1,
'wireless': 1}
sorted in descending order:
{'technology': 2, 'is': 2, 'Bluetooth': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1,
'powered': 1, 'wireless': 1, 'that': 1, 'used': 1, 'to': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1,
'a': 1,
'high': 1,
'is': 2,
'low': 1,
'powered': 1,
'speed': 1,
'technology': 2,
'that': 1,
'to': 1,
'trnsmit': 1,
'used': 1,
'wireless': 1}
sorted in descending order:
{'technology': 2, 'is': 2, 'Bluetooth': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1,
'powered': 1, 'wireless': 1, 'that': 1, 'used': 1, 'to': 1, 'trnsmit': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1,
'a': 1,
'and': 1,
'high': 1,
'is': 2,
'low': 1,
'powered': 1,
'speed': 1,
'technology': 2,
'that': 1,
'to': 1,
'trnsmit': 1,
'used': 1,
'wireless': 1}
sorted in descending order:
{'technology': 2, 'is': 2, 'Bluetooth': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1,
'powered': 1, 'wireless': 1, 'that': 1, 'used': 1, 'to': 1, 'trnsmit': 1, 'and': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1,
'a': 1,
'and': 1,
'high': 1,
'is': 2,
'low': 1,
'powered': 1,
'recieve': 1,
'speed': 1,
'technology': 2,
'that': 1,
'to': 1,
'trnsmit': 1,
'used': 1,
'wireless': 1}
sorted in descending order:
{'technology': 2, 'is': 2, 'Bluetooth': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1,
'powered': 1, 'wireless': 1, 'that': 1, 'used': 1, 'to': 1, 'trnsmit': 1, 'and': 1, '
recieve': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1,
'a': 1,
'and': 1,
'data': 1,
'high': 1,
'is': 2,
'low': 1,
'powered': 1,
'recieve': 1,
'speed': 1,
'technology': 2,
'that': 1,
'to': 1,
'trnsmit': 1,
'used': 1,
'wireless': 1}
sorted in descending order:
{'technology': 2, 'is': 2, 'Bluetooth': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1,
'powered': 1, 'wireless': 1, 'that': 1, 'used': 1, 'to': 1, 'trnsmit': 1, 'and': 1, '
recieve': 1, 'data': 1}
frequency of words appeared in the semetence
{'Bluetooth': 1,
'a': 1,
'and': 1,
'data': 1,
'high': 1,
'is': 2,
'low': 1,
'powered': 1,
'recieve': 1,
'serially.': 1,
'speed': 1,
'technology': 2,
'that': 1,
'to': 1,
'trnsmit': 1,
'used': 1,
'wireless': 1}
sorted in descending order:
{'technology': 2, 'is': 2, 'Bluetooth': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1,
'powered': 1, 'wireless': 1, 'that': 1, 'used': 1, 'to': 1, 'trnsmit': 1, 'and': 1, '
recieve': 1, 'data': 1, 'serially.': 1}
10 most frequently appered word in a paragraph:
{'technology': 2, 'is': 2, 'Bluetooth': 1, 'a': 1, 'high': 1, 'speed': 1, 'low': 1,
'powered': 1, 'wireless': 1, 'that': 1}
[ ]:
Click to add a cell.