'split text file with lines into mutiple lines by nth numbers

I am trying make script that split text file with lines into multiple lines group in python3 here is an example:

text file contains:
1
2
3
4
5
6
7
8
9
10

output that I want:
first chunk
1
2
3

second chunk
4
5
6

third chunk
7
8
9

fourth chunk
10

how can I do that? and thank you in advance



Sources

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

Source: Stack Overflow

Solution Source