We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Even Teams

Fantasy Quest PvP teams are uneven when the match begins. We need a function that will correctly split the two teams evenly.

Interactive example available with JavaScript enabled.

Assignment

Complete the get_even_and_odd_teams function.

It accepts a list of players (strings representing their names) and returns two lists in this order:

  1. A new list of all the players with even-numbered indexes in the original list.
  2. A new list of all the players with odd-numbered indexes in the original list.

Use the slice syntax with a "step" to create two new lists from the players list. Don't be afraid to consult your spellbook for list slicing help!