Python Programming 2 Libraries RANDOM
Python Programming 2 Libraries RANDOM
- It contains modules, such as Tkinter and turtle, which are available without the need to
download or install any additional code.
- This
programs
module
to
enables
include
calculations or outputs based
on random numbers.
PYGAME
TEAM ALLOCATOR
TEAM ALLOCATOR
- This project will use Python’s random module to form teams, with
randomly selected players.
- The random module will then shuffle this list into a different order.
- Loops will be used to iterate through the list and display the players.
- Finally, an if statement checks to see if the user is happy with the selection.
TEAM ALLOCATOR
• This project will pick two teams
and a captain for each team.
When you run the program, it will
display the chosen teams and
captains on the screen.
High-level languages
Program design
• The program begins by shuffling the player list.
• It then allocates the first half as Team 1, randomly selects a captain, and
displays the name of the captain along with the names of the rest of the
team.
• The steps are then repeated for the second half of the list – forming Team 2.
If you want to pick the teams again, the program repeats the steps,
otherwise, the program ends.
Program design
Result
HACKS AND TWEAKS
Add more players
More teams
Who starts?