-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lecture "Brute-force algorithms", exercise 3 #17
Comments
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()
|
I tried to use len() as in the Insertion sort algorithm, and for once it worked! YEY!
|
Thanks to @delfimpandiani for the patience and the help (you're a very good teacher):
|
Thank you @delfimpandiani and @federicafaithbologna hugs and kisses :)
print(test_my_enumerate((['Miami', 'Heat', '23']), [('Miami', 0), ('Heat', 1), ('23', 2)])) |
|
I had to look at my colleagues examples, but in the end I've understood the logic behind the following example
|
@essepuntato shouldn't we put the built in function enumerate() as expected result? |
|
|
Hi all, here my take on the exercise (available also as Python file in the GitHub repository), with some comments:
Some comments:
|
Write in Python the function
def my_enumerate(input_list)
which behave like the built-in functionenumerate()
introduced in Section "Linear search" and returns a proper list, and accompany the function with the related test case. It is not possible to use the built-in functionenumerate()
in the implementation.The text was updated successfully, but these errors were encountered: