def prompt_vote_poll(): poll_id = int(input("Enter poll you would like to vote on: ")) _print_poll_options(Poll.get(poll_id).options) option_id = int(input("Enter option you'd like to vote for: ")) username = input("Enter the username you'd like to vote as: ") Option.get(option_id).vote(username)
def prompt_vote_poll(): poll_id = int(input("Введите номер опроса, где хотели бы проголосовать: ")) try: _print_poll_options(Poll.get(poll_id).options) option_id = int(input("Выберете интересующий Вас пункт: ")) username = input("Введите свой ник: ") Option.get(option_id).vote(username) except TypeError: print("Нет опроса под этим номером!")
def randomize_poll_winner(): poll_id = int(input("Enter poll you'd like to pick a winner for: ")) _print_poll_options(Poll.get(poll_id).options) option_id = int(input("Enter which is the winning option, we'll pick a random winner from voters: ")) votes = Option.get(option_id).votes winner = random.choice(votes) print(f"The randomly selected winner is {winner[0]}.")
def randomize_poll_winner(): poll_id = int(input("Enter poll you'd like to see a winner for: ")) poll = Poll.get(poll_id) print_poll_options(poll.options) option_id = int(input("Input id of option: ")) option = Option.get(option_id) votes = option.votes winner = random.choice(votes) print(f"winner is {winner[0]}!")
def prompt_vote_poll(): poll_id = int(input("Enter poll would you like to vote: ")) poll = Poll.get(poll_id) poll_options = poll.options print_poll_options(poll_options) users_choice = int(input("Now choice the option: ")) option = Option.get(users_choice) users_name = input("Enter your name: ") option.vote(users_name)
def randomize_poll_winner(): poll_id = int( input("Введите номер опроса, где хотите выбрать победителя: ")) _print_poll_options(Poll.get(poll_id).options) option_id = int( input( "Введите номер выигрышного ответа, победитель будет выбран из проголосавших за него: " )) votes = Option.get(option_id).votes winner = random.choice(votes) print(f"Произвольно выбранный победитель: {winner[0]}.")