Write a program to accept 10 names in single dimensional array (SDA). Display all those names whose first letter matches with the letter entered by the user.
Sample Input: Aman Shahi
Amol Patil
Suman Gupta and so on ............. Sample Output: Enter the alphabet
A
Aman Shahi
Amol Gupta
Please answer only if you know!!!
Answers
Answered by
0
names = [
"Sophia Wilson",
"Emma Moore",
"Eva Ward",
"Oliva Kelly",
"Emily Corry",
"Madison Bolton",
"Claire Brecker",
"Samantha Garcia",
"Taylor Davis",
"Ellie Barbara"]
c = input("enter character: ")
filtered_names = [name for name in names if c == name.split()[0][0]]
print("\n".join(filtered_names))
Answered by
2
Answer:
...
Explanation:
Wait Jhalak I'll tell this to Eknath Sir
Similar questions