Write a Python Program to count the number of characters in the string and store them in a dictionary.

 str1=input("Enter the string")

dict1={str1:len(str1)}

print("The resultant dictionary is",dict1)

Comments

Popular posts from this blog

Write a python program to compute cumulative product of a list of numbers (write function cumulative_product).

Write a Python program to compute distance between two points taking input from the user. Formula for Pythagorean theorem for compute distance between two points is: