Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Python function that returns only even numbers from a given list. Sample List: [1, 2, 3, 4, 5, 6, 7, 8, 9] Expected
Write a Python function that returns only even numbers from a given list. Sample List: [1, 2, 3, 4, 5, 6, 7, 8, 9] Expected Result: [2, 4, 6, 8] Using your in-class assignment: on-line grocery shopping, do the following. a. Create a new file that builds a shopping list from a user. There should be a input query that asks the user to list an item and the number of those items. Two lists should be built that reflects the items on the list and the number of each items that are to be purchased. The list should build until the user is done. b. Call up your function grocery_cost to check the stock and build your total cost. Your program should let the user know if the items they want are in stock. If there is not enough stock, your program should let the user know that and offer them the number that are in stock. You will need to edit your grocery_cost function to reflect that a number of items will be selected instead of just one. c. Call up your stock_check function and print items that need restocking. Implement a recursive Bubble Sort function that can sort a given list of numbers. Create a script that will: a. read a list from file rand_numb.txt on Canvas, b. use your BubbleSort function to sort the list, and c. print the result
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started