Define a function shiftRight which receives a list as input, and returns a list with all the elements shifted to the right

The solution for “Define a function shiftRight which receives a list as input, and returns a list with all the elements shifted to the right” can be found here. The following code will assist you in solving the problem.

values = [2, 3, 5, 7, 11, 13]

def shift(list):
new_list = []

for i in list:
new_list.insert(len(new_list)-1, i)

return new_list

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in