Share
upper case tuple without loop
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Convert all strings in [“mi”, “kkr”, “rcb”, “pbks”, “dd”] to upper case, w/o s=using for loop.
Answers ( 3 )
def uc(a):
return a.upper()
ans=map(uc, (“mi”, “kkr”, “rcb”, “pbks”, “dd”))
c = [“mi”, “kkr”, “rcb”, “pbks”, “dd”]
for i in c:
print(i.upper())
s=[“mi”, “kkr”, “”rcb”, “pbks”, “dd”]
print(list(map(lambda x: x.upper(),s)))