Dec-30-2019, 02:24 AM
def foo(s,n): ?????????? def bar(s,n): ?????????? def boo(s,n): ?????????? def far(s,n): ?????????? a=[x for x in range(10)] for z in foo(a,3): print(*z) print() for z in bar(a,4): print(*z) print() for z in boo(a,3): print(*z) print() for z in far(a,4): print(*z)
Output:0 1 2
1 2 3
2 3 4
3 4 5
4 5 6
5 6 7
6 7 8
7 8 9
8 9
9
0 1 2
3 4 5
6 7 8
9
0 1 2
1 2 3
2 3 4
3 4 5
4 5 6
5 6 7
6 7 8
7 8 9
0 1 2
3 4 5
6 7 8
there are 4 different functions with similarities and differences. i'm trying to come up with a good name scheme for these.