Python Write Program Contains Array Friends First Names Enter Values Manner Order Choose R Q37184257

In Python, write a program that contains an array with all ofyour friends’ first names. Enter the values in any manner and orderyou choose (I recommend favorites first). Now take that array andsort it alphabetically so that names that start with ‘A’ comefirst. Look to see if you have any duplicates and if you find any,print out their names. You may use a binary search to determinethis.

Sample output:

Input list of names: Bob, Sourav,John, Jeff, Kevin, Kevin, Shweta, Neil, Anderson

Ordered list of names: Anderson, Bob, Jeff, John, Kevin, Kevin,Neil, Shweta, Sourav

We have two “Kevin”s.


Answer


1 ef bubbleSort (a): 2 for i in range(len )): for j in range(i+1, len(a)) if a[i] > a[1]: 4 6 7 names-input(Enter list of na

def

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.