Информатика, вопрос задал Rashad138pro , 1 год назад

Напиши программу, которая:
- просит ввести по очереди 3 названия аккаунта в Instagram,
- затем просит ввести число подсписчиков для каждого аккаунта.
Программа определяет, у какого аккаунта подписчиков больше всего и выводит сообщение на экран.

Приложения:

Ответы на вопрос

Ответил Аноним
1

Відповідь:

Here is a Python program to do what you asked for:

from instabot import Bot

bot = Bot()

accounts = []

followers = []

# Get names of 3 accounts from user

for i in range(3):

   account = input('Enter name of account {}: '.format(i+1))

   accounts.append(account)

# Get followers count of each account

for account in accounts:

   followers.append(bot.get_followers_count(account))

# Find account with most followers

max_followers = max(followers)

max_index = followers.index(max_followers)

# Print result

print('The account with most followers is {} with {} followers'.format(accounts[max_index], max_followers))

If something is wrong, write in the comments, I will correct the answer

Have a nice day!!!


Rashad138pro: Unfortunately its wrong. It give :
Module 'instabot.py' not found
Новые вопросы