Skip to content

Functions#7

Open
MartaGDC wants to merge 2 commits intoIronhack-data-bcn-oct-2023:mainfrom
Lab-Ironhack:main
Open

Functions#7
MartaGDC wants to merge 2 commits intoIronhack-data-bcn-oct-2023:mainfrom
Lab-Ironhack:main

Conversation

@MartaGDC
Copy link
Copy Markdown

No description provided.

@sh-ih
Copy link
Copy Markdown

sh-ih commented Oct 13, 2023

Marta,
Great job on this lab!

Some comments:

On question 2, your function passes the test but there is a case were setting largest=0 would create some issues when your array has only negative numbers. If you run: greatest([-1,-5,-800]) you’ll get 0 as result, instead of -1.

A way to deal with this cases is to set largest=+inf. In Python, +inf is an unbounded upper value. Another option would be to set largest=arr[0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants