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, 22.06.2019 00:30
Advantages and disadvantages of binary system
Answers: 1
question
Computers and Technology, 22.06.2019 07:00
You will be given two character arrays of the same size, one will contain a number of ships. ships will move around the character array based on which way they are facing and the route they are on. routes are given in the other array. the route consists of '-' and '|' for straight paths, '\' and '/' for curves, and '+' for intersections. there are ships on these routes. ships always face a direction, '^' for up, '> ' for right, 'v' for down, and '< ' for left. any time the ships hit a '\' or a '/' it will turn as you would expect a ship to turn (e.g. a '^' that moves into a '/' will turn right). at an intersection, ships will always continue straight through. all ships move at the same speed, ships take turns moving and all ships move during one 'tick'. the one in the most top left goes first, followed by those to its right, then the ones in the next row. it iterates along the rows and then down the columns. each ship moves one space on its turn moving along the route. your function needs to return the position of the first collision between two ships and the number of ticks before the crash occurred.
Answers: 2
question
Computers and Technology, 24.06.2019 07:20
Ingrid started speaking about her slide presentation. when she clicked to th"third slide, which had just a picture of an elephant, she forgot what she wassupposed to talk about. what could ingrid do to avoid this situation in thefuture? oa. print handouts for her audience.ob. add presenter's notes to each slide.oc. add a video to each slide.od. save her slide presentation to a flash drive
Answers: 2
question
Computers and Technology, 24.06.2019 17:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately
Answers: 2
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, 19.04.2021 22:50
question
Mathematics, 19.04.2021 22:50
question
Social Studies, 19.04.2021 22:50
question
Social Studies, 19.04.2021 22:50
question
Mathematics, 19.04.2021 22:50
Questions on the website: 13722363