Delfina Sol Martinez Pandiani
Delfina Sol Martinez Pandiani
My original approach (before giving a look to you guys') gives the right result but has the defect of running forever: | Current State| Type Symbol | Write Symbol |...
If I understood the prompt correctly, the point of the exercise is to create a new function called my_enumerate(), which should behave just like the built-in function enumerate() ``` def...
I struggled with this one and decided to check out my classmates' answers; > I came up with two different solutions (they work with any given input): the first makes...
I was a little stuck and @Hizkie's answer was very helpful. I did not see the need for enumerating the original list, and it worked with doing so. But I...
``` def linear_search(input_list, value_to_search): # defines the function linear_search and the parameters to be used for position, item in enumerate(input_list): # the input_list is enumerated (creates a list with each...
This was took quite a long while. There is probably a cleaner, shorter way to solve this. Here is one that, at least, works for many different inputs: Clean code:...
Here is another way.. Guys help me clean this up, I'm sure it can be cleaner Clean code ``` def test_partition(input_list, start, end, pivot_position, expected): result = partition(input_list, start, end,...
@ilsamoano Here is what I meant on my voice note: ``` def test_partition(input_list, start, end, pivot_position, expected): result = partition(input_list, start, end, pivot_position) if result == expected: return "true" else:...
Simple, clean approach based on Prof. Peroni's explanation in class today. ``` def test_partition(input_list, s, e, pp, expected): result = partition(input_list, s, e, pp) if result == expected: return True...
``` # Test case for the exponentiation algorithm def test_fib(n, expected): result = fib(n) if expected == result: return True else: return False # Code of the exponentiation algorithm def...