Skip to content

lab-functions#9

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

lab-functions#9
Estherkii wants to merge 2 commits intoIronhack-data-bcn-oct-2023:mainfrom
IronLabWorks:main

Conversation

@Estherkii
Copy link
Copy Markdown

No description provided.

@sh-ih
Copy link
Copy Markdown

sh-ih commented Oct 13, 2023

Esther,
Great job!

Some comments:
On question 5, you could simplify your code by calling the functions you created on the previous two questions:

def oper_all(arr, oper):
    if oper == "+":
        return sum_all(arr)
    elif oper == "*":
        return mult_all(arr)

It is ok to use the initial code on each question (def name_of_function(): pass), just delete the pass and put your code. There is no need to keep that initial code and then repeat the def name_of_function.
In this lab, it won’t give you problems, but when you have two functions with the same name on different cells, later you may encounter issues because of you are not sure which was the last one to be run.

Regarding question 11, a possible way to solve it is to create a dictionary where each key is an element of your array and the value is the frequency. Then you can look for the key that has the biggest value

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