In this python dictionary program, we will clear all items from the dictionary using an in-built function.
Steps to solve the program
- Take a dictionary as input.
- Clear all items from the given dictionary using clear().
- Print the output.
dict1 = {'Name':'Harry','Rollno':345,'Address':'Jordan'}
dict1.clear()
print(dict1)
Output :
{}