Python memindahkan item dalam daftar untuk mengakhiri

# initializing list
test_list = [3, 5, 7, 9, 11]

# printing original list
print("The original list =", test_list)

# using append() + pop() + index()
# moving element to end
test_list.append(test_list.pop(test_list.index(5)))

# printing result
print("The modified list =", test_list)

# output =
# The original list = [3, 5, 7, 9, 11]
# The modified list = [3, 7, 9, 11, 5]
Kodi4444