subject

#write a function called alter_list. alter_list should have#two parameters: a list of strings and a list of integers.##the list of integers will represent indices for the list of#strings. alter_list should alter the capitalization of all#the words at the designated indices. if the word was all#capitals, it should become all lower case. if it was all#lower case, it should become all capitals. you may assume#that the words will already be all-caps or all-lower case.##for example: ## string_list = ["hello", "world", "how", "are", "you"]# index_list = [0, 2]# alter_list(string_list, index_list) -> # ["hello", "world", "how", "are", "you"]##after calling alter_list, the strings at indices 0 and 2#have switched their capitalization. ##note that it may be the case that the same index is present#in the second twice. if this happens, you should switch the#text at that index twice. for example: ## string_list = ["hello", "world", "how", "are", "you"]# index_list = [0, 2, 2]# alter_list(string_list, index_list) -> # ["hello", "world", "how", "are", "you"]##2 is in index_list twice, so the string at index 2 is#switched twice: capitals to lower case, then back to#capitals.#write your function here! #below are some lines of code that will test your function.#you can change the value of the variable(s) to test your#function with different inputs.##if your function works correctly, this will originally#print: #["hello", "world", "how", "are", "you"]#["hello", "world", "how", "are", "you"]print(alter_list(["hello", "world", "how", "are", "you"], [0, 2]))print(alter_list(["hello", "world", "how", "are", "you"], [0, 2, 2]))

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:30
This isn’t really school related, but like where the heck can you find manga, to read to where you don’t have to pay money, for points? my friend wants me to read bj alex, and i can’t find it anywhere for free.
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
Amedian in the road will be marked with a white sign that has a black arrow going to the left of the median. true false
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Apart from confidential information, what other information does nda to outline? ndas not only outline confidential information, but they also enable you to outline .
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
You are most likely to automatically encode information about
Answers: 1
You know the right answer?
#write a function called alter_list. alter_list should have#two parameters: a list of strings and a...
Questions
question
Mathematics, 15.12.2020 20:30
question
Mathematics, 15.12.2020 20:30
question
Mathematics, 15.12.2020 20:30
question
Mathematics, 15.12.2020 20:30
question
Mathematics, 15.12.2020 20:30
question
Mathematics, 15.12.2020 20:30
question
Mathematics, 15.12.2020 20:30
Questions on the website: 13722362