Skip to content

Selma_ - #19

Open
KirbyDream wants to merge 1 commit into
Ironhack-data-bcn-oct-2022:mainfrom
KirbyDream:main
Open

Selma_#19
KirbyDream wants to merge 1 commit into
Ironhack-data-bcn-oct-2022:mainfrom
KirbyDream:main

Conversation

@KirbyDream

Copy link
Copy Markdown

No description provided.

@samuelTAIronhack samuelTAIronhack left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For question 8 have a look at the following solution


def mode_counter(arr):
#define all counts 
    count = 0
    max_count = 0
    mode = 0
    for element in arr:
        for i in arr:
            if i == element:
                count +=1
# Check which is bigger? "size matters in this case"
        if count > max_count:
            max_count = count
            mode = element
        count = 0
    return mode

see if this solution makes sense to you!

Keep up the good work!

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