'aiogram: How to group, format and send multiple dictionaries

You need to send separate messages schedule for different days. Here is an example input:

raspisanie = [{'week_day': 'Monday, 'name': 'Lesson 1', 'time': '8:30'}, {'week_day': 'Tuesday', name: 'Lesson 1', 'time': '8:30'}, {'week_day': 'Tuesday', name: 'Lesson 2', 'time': '10:30'}])

I can’t figure out how to send one SMS every day so that it looks like this:

First SMS: Monday Lesson 1 8:30 Second SMS: Tuesday Lesson 1 8:30 Lesson 2 10:30

Only the cycle inside message.answer comes to mind, but this is not possible. I will be glad for any help)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source