Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Challenge Solution

youssef b10ta
youssef b10ta
Courses Plus Student 2,755 Points

Here is My Aprproach

players = []
answer = 'yes'
while answer == 'yes':
        answer = input('Would you like to add a player to your list yes|no  ').lower()
        if answer == 'yes':
            add_name = input('Enter the name of the player you like like to add ')
print('The number of the players on this team is {}'.format(len(players)))
count = 0
while count < len(players):
    print('Player {}: {}'.format(count+1 , players[count]))
    count += 1
goalkeeper = int(input('Please Select a goalkeeper from 1-{}  '.format(len(players))))
print('The Goalkeeper for this game will be {}'.format(players[goalkeeper-1]))
3,629 Points

great code!, but just a correction (btw innecesary but it's always up to what actually is asking)

the first question is "Would you like to add 'A' player" next ones are "Would you like to add 'ANOTHER' player"

as I repeat it's innecesary but sometimes clients are picky.

again nice, code!

1 Answer

Eldin Guzin
Eldin Guzin
6,010 Points

Nice work!,That really is a unique way of approaching this :D