Bears 4 Sharks 7 Cats 9 Hedgehogs 6 Ants 2 Aardvarks 11 Your program should prod
ID: 3746479 • Letter: B
Question
Bears 4
Sharks 7
Cats 9
Hedgehogs 6
Ants 2
Aardvarks 11
Your program should produce output like this:
>>>
The Bears have won 4 games
The Sharks have won 7 games
The Cats have won 9 games
The Hedgehogs have won 6 games
The Ants have won 2 games
The Aardvarks have won 11 games
Teams with names shorter than 5 letters: ['Cats', 'Ants']
The three teams with the most wins are: ['Aardvarks', 'Cats', 'Sharks']
My question is below:
Use a list comprehension to create a list of the names of teams with less than 5 letters in their name.
Explanation / Answer
Please find the Python code below:-
Please let me know in case of any clarifications required. Thanks!