python如何轮流且循环执行多个语句?

比如有123三个函数输入任意数字n
如输入n=4使程序执行1231?

定义一个函数,通过判断调用不同的子函数

def child1():
    print('child1')


def child2():
    print('child2')


def child3():
    print('child3')


def main(i):
    if i == 1:
        child1()
    elif i == 2:
        child2()
    elif i == 0:
        child3()


n = 4
for i in range(1, n + 1):
    main(i % 3)

def hs1():
    print("hs1")

def hs2():
    print("hs2")

def hs3():
    print("hs3")

hs_data =[hs1,hs2,hs3]

a=int(input("输入你的数字:"))
num=a%3
hs_data[num-1]()
不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^