I'm trying to make the names descend from z-a. I'm trying to sort the list in reverse alphabetical order and then loop through the entire list to print each celebrity's name on its own line
def main():
print('Celebrities known by one name:')
drake = ['Drake']
BE = ['Beyonce']
RI = ['Rihanna']
BO = ['Bono']
print('Drake','Beyonce','Rihanna', 'Bono')
a = input('Enter another one name celebrity ')
b = input('Enter another one name celebrity ')
c = input('Enter another one name celebrity ')
d = [a,b,c,drake,BE,RI,BO]
f = reversed(d)
print('Celebrities in Reverse Alpha Order')
for d in f:
print(d)
main()
So far I'm getting is this
['Bono']
['Rihanna']
['Beyonce']
['Drake']
Eminem
Adele
Pink
Its suppose to look like
Celebrities known by one name:
Drake Beyonce Rihanna Bono
Enter another one name celebrity Adele
Enter another one name celebrity Eminem
Enter another one name celebrity Pink
Celebrities in Reverse Alpha Order
Rihanna
Pink
Eminem
Drake
Bono
Beyonce
Adele