Skip to content

Bubblesort#5

Open
mshinners wants to merge 10 commits intomasterfrom
bubblesort
Open

Bubblesort#5
mshinners wants to merge 10 commits intomasterfrom
bubblesort

Conversation

@mshinners
Copy link
Owner

No description provided.

"""Bubblesort sorting method."""


def bubblesort(list):

Choose a reason for hiding this comment

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

Be careful with variable names. list is a keyword built into python and shouldn't be overridden.

for i in range(num):
for j in range(0, num - i - 1):
if list[j] > list[j + 1]:
list[j], list[j + 1] = list[j + 1], list[j]

Choose a reason for hiding this comment

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

Your function doesn't return anything.

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

Comments