I want to check weather number present in the dictionary or not ?- Nested dictionary | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 2

I want to check weather number present in the dictionary or not ?- Nested dictionary

def check(check,number): for key,value in check.items(): if number is (key,value): print("yes") else: print("No") check({1:{2:{3:{4:5}}}},4)

2nd Feb 2022, 10:25 AM
Manoj Bhaagam
3 Réponses
+ 1
Slick , you code doesn't work with nested dict, needs some changes
2nd Feb 2022, 12:10 PM
Vitaly Sokol
Vitaly Sokol - avatar
2nd Feb 2022, 9:22 PM
Slick
Slick - avatar
2nd Feb 2022, 10:52 AM
Slick
Slick - avatar