Skip to content

Instantly share code, notes, and snippets.

@gonaumov
Created January 12, 2024 16:32
Show Gist options
  • Save gonaumov/df73a62d54e653a94c7fe5db27fdad3d to your computer and use it in GitHub Desktop.
Save gonaumov/df73a62d54e653a94c7fe5db27fdad3d to your computer and use it in GitHub Desktop.
Random item generator
import random
first_group = [1, 2, 3]
second_group = [5, 4, 6]
third_group = [7, 8, 9]
def print_winner(group, group_name):
print(f'The winner from {group_name} is {random.choice(group)}')
print_winner(first_group, 'first group')
print_winner(second_group, 'second group')
print_winner(third_group, 'third group')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment