+ 2
What if I have 50 names? How to make it simpler? Any suggestions
4 Réponses
+ 2
https://code.sololearn.com/cQQvIyMsCHW5/?ref=app
For loop
+ 1
secrets = [x[0].upper() for x in friends]
0
#use for loop bro ;)
def society_name(friends):
secret=""
for friend in friends:
secret += friend[0].upper()
x=sorted(secret)
y=("").join(x)
return y
print(society_name(["karthik","sara","Jane"]))
0
sec = [name.capitalize()[0] for name in friends]