I have a string consisting of space separated nos : 5 4 4 2 2 8
.
I want to construct a dictionary out of this which would have the no of times each no appear in the above string .
I first try to construct a list out of the above input line by the below code :
nos = input().split(" ")
print (nos)
Now i want to iterate through the above list using dict comprehension to create the dictionary .
How can i do the same , can someone please help?