WebJul 11, 2024 · Use OK to test your code: python3 ok -q replace_all Optional Questions Question 7: Deep map. Write the function deep_map_mut that takes a Python list and mutates all of the elements (including elements of sublists) to be the result of calling the function given, fn, on each element.Note that the function does not return the mutated list! WebQuestion 6. (Reinforcement - More Challenging) Recall the capitalize function from Homework 5: given a list of strings (which are words), capitalize each string if the …
CS61A/lab10.scm at master · PKUFlyingPig/CS61A · GitHub
WebImplement a procedure remove that takes in a list and returns a new list with all instances of item removed from lst. You may assume the list will only consist of numbers and will not … WebHomework 6: Object Oriented Programming, Linked Lists hw06.zip; Due by 11:59pm on Thursday, March 16. Instructions. Download hw06.zip.Inside the archive, you will find a file called hw06.py, along with a copy of the ok autograder. Submission: When you are done, submit the assignment by uploading all code files you've edited to Gradescope. mountain meandering photography
Homework 7 CS 61A Fall 2024 - University of California, …
WebQ2: Split. Implement split-at, which takes a list lst and a non-negative number n as input and returns a pair new such that (car new) is the first n elements of lst and (cdr new) is the remaining elements of lst. If n is greater than the length of lst, (car new) should be lst and (cdr new) should be nil. (define (split-at lst n) 'YOUR-CODE-HERE ... WebQ3: Insert Items. Write a function which takes in a list lst, an argument entry, and another argument elem.This function will check through each item in lst to see if it is equal to entry.Upon finding an item equivalent to entry, the function should modify the list by placing elem into lst right after the item. At the end of the function, the modified list should be … Webdef filter(lst, pred): if lst == [ ]: return [] Now lets think about our recursive case. We know we want to return a list and we want to construct the list as we progress in our recursion. And we know we need to check our pred function with the current input some how. So what would the next step be? def filter(lst, pred): if lst == [ ]: return ... hearing kids cry meme