In this Python list program, we will take a user input as a list and get length of each word and add it as a dictionary with the help of the below-given steps.
Get length of each word in list:
Steps to solve the program
- Take a list containing words as input.
- Create an empty dictionary and a list.
- Use for loop to iterate over each word in the given list and add the word as key in the dictionary and its length as value.
- Add that dictionary to the list.
- Print the list to see the output.
Output :
Related Articles
Python program to remove duplicate dictionaries from the given list.
Python program to decode a run-length encoded given list.
Python program to round every number in a given list of numbers and print the total sum of the list.
Python Program to get the Median of all the elements from the list.
Python Program to get the Standard deviation of the list element.
Python program to convert all numbers to binary format from a given list.