Kevin Tiller

Generation

generate functionSun, 23 Apr 2023

Write a function that changes the value at given index i of a given list a_list to a given value new_value if the described conditions are met. Modify a_list in place. No need to return anything!

def change_value(a_list, i, new_value): if i < len(a_list): a_list[i] = new_value return a_list

Want to kickstart your project?Use the new AI Studio to create your code