Given:

res_interest = ['Прыжки с парашютом', 'Прыжки с парашютом', 'страйк-бол', 'фантастика'] 

or

 res_interest = Counter({'Прыжки с парашютом': 2, ' страйк-бол': 1, ' фантастика': 1}) 

You must obtain the following list:

 result = [('Прыжки с парашютом', 2), ('страйк-бол', 1), ('фантастика', 2)] 
  • I'm not sure I understood the question. Stop in debug and see the type of variables? - Alexander Alexandrov

1 answer 1

 from collections import Counter res_interest = Counter({'Прыжки с парашютом': 2, ' страйк-бол': 1, ' фантастика': 1}) print(res_interest) print(list(res_interest.items())) # [('Прыжки с парашютом', 2), (' страйк-бол', 1), (' фантастика', 1)]