upper case tuple without loop

Question

Convert all strings in [“mi”, “kkr”, “rcb”, “pbks”, “dd”] to upper case, w/o s=using for loop.

 

in progress 0
YashikaKhurana 4 years 3 Answers 822 views Master 0

Answers ( 3 )

  1. def uc(a):
    return a.upper()

    ans=map(uc, (“mi”, “kkr”, “rcb”, “pbks”, “dd”))

  2. c = [“mi”, “kkr”, “rcb”, “pbks”, “dd”]

    for i in c:
    print(i.upper())

  3. s=[“mi”, “kkr”, “”rcb”, “pbks”, “dd”]
    print(list(map(lambda x: x.upper(),s)))

Leave an answer

Browse
Browse