How to findthe length of the given dictionary by using for loop...? | Sololearn: Learn to code for FREE!

+3

How to findthe length of the given dictionary by using for loop...?

Given dictionary is: squares = {1: 1, 3: 9, 5: 25, 7: 49, 9: 81}

5/24/2022 2:16:54 PM

Mihir Lalwani

3 Answers

New Answer

+2

Setup a variable named <size>, initialize it by zero Run a for...in loop on the <squares> dictionary Increment <size> on each loop iteration

+4

Ya i try this sol.. and its compile..

+1

Do you have a code where you've tried?