Question 3 Write a setNewElement function that yields the following behavior when runGenerations( [1,2,3,4,5,42] ) is called. code example
Example: Question 3 Write a setNewElement function that yields the following behavior when runGenerations( [1,2,3,4,5,42] ) is called.
>>> runGenerations([1, 2, 3, 4, 5, 42])
[1, 2, 3, 4, 5, 42]
[2, 3, 4, 5, 42, 1]
[3, 4, 5, 42, 1, 2]
[4, 5, 42, 1, 2, 3]
[5, 42, 1, 2, 3, 4]
[42, 1, 2, 3, 4, 5]
[1, 2, 3, 4, 5, 42]
[2, 3, 4, 5, 42, 1]