Skip to content

functions vb#20

Open
victorbescos wants to merge 2 commits intoIronhack-data-bcn-oct-2023:mainfrom
victorbescos:main
Open

functions vb#20
victorbescos wants to merge 2 commits intoIronhack-data-bcn-oct-2023:mainfrom
victorbescos:main

Conversation

@victorbescos
Copy link
Copy Markdown

No description provided.

@sh-ih
Copy link
Copy Markdown

sh-ih commented Oct 16, 2023

Victor

Good job on this lab!

The instructions asked you to try to write all the functions yourself, without using the already existing functions in Python.
On question 2, you used sum() and on question 3 you used max().

Those two could be solved without those functions:

def greatest(arr):
    the_greatest = arr[0]
    for i in arr:
        if i > the_greatest:
            the_greatest = i
    return the_greatest

def sum_all(lst):
    counter = 0
    for num in lst:
        counter += num
    return counter

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