Question: I NEED THIS DONE IN PYTHON PLEASE Assignment 6 A: Sorting with Bubble Sort Write a Python function called bubble _ sort which takes in
I NEED THIS DONE IN PYTHON PLEASE
Assignment A: Sorting with Bubble Sort
Write a Python function called bubblesort which takes in a list of numbers. It must perform a bubble sort on the list. Note you may not use the built in list.sort function, you must implement a bubble sort from scratch. It must return a sorted list of numbers.
Write a Python function called countpositive which takes in a list of numbers. It must count how many numbers in the list are positive. Return the number of positive numbers in the list.
Write a Python function called countnegative which takes in a list of numbers. It must count how many numbers in the list are negative. Return the number of negative numbers in the list.
Outside of the above functions, prompt the user to enter in a line of numbers. The users should give you a string made up of numbers separated by spaces. Convert the string into a list of numbers.
Call the bubblesort function passing it the list of numbers you created from the users input.
Call the countpositive, and countnegative functions, and store the result.
Finally, print out the sorted list, and a count of how many numbers are positive and how many are negative.
Requirements:
Youmust implement the bubble sort algorithm manually.
Do not use any builtin sorting functions.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
