Advertisements
Advertisements
प्रश्न
Write a function countNow (PLACES) in Python, that takes the dictionary, PLACES as an argument and displays the names (in uppercase) of the places whose names are longer than 5 characters.
For example, Consider the following dictionary
PLACES={1:"Delhi",2:"London",3:"Paris",4:"New York",5:"Doha"}
The output should be:
- LONDON
- NEW YORK
थोडक्यात उत्तर
Advertisements
उत्तर
PLACES={1:"Delhi",2: "London", 3: "Paris", 4: "New York",5:"Dubai"}
def countNow (PLACES) :
for place in PLACES. values ():
if len (place) > 5:
print (place. upper ())
countNow (PLACES)shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
