YouTip LogoYouTip

Python3 Att Dictionary Clear

# Python3.x Python3 Dictionary clear() Method [![Image 3: Python3 Dictionary](#) Python3 Dictionary](#) * * * ## Description The Python dictionary clear() function is used to remove all elements from the dictionary. ## Syntax The syntax for the clear() method is: dict.clear() ## Parameters * NA. ## Return Value This function does not return any value. ## Example The following example demonstrates the usage of the clear() function: ## Example #!/usr/bin/python3 tinydict ={'Name': 'Zara','Age': 7} print("Dictionary Length : %d" % len(tinydict)) tinydict.clear() print("Dictionary Length after clear : %d" % len(tinydict)) The output of the above example is: Dictionary Length : 2Dictionary Length after clear : 0 * * Python3 Dictionary](#)
← Java Arraylist TostringJava Arraylist Sort β†’