Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ask a user for a number and then determine what numbers in the list [0,1,2,3,4,5,6,7,8,9,10] are larger than the number entered by the user. Assign

Ask a user for a number and then determine what numbers in the list [0,1,2,3,4,5,6,7,8,9,10] are larger than the number entered by the user. Assign the number entered by the user to a variable named "n".

Details:

In a Python program, write a function named "largerThan" that accepts two arguments: a list, and a number. Call this function from a main() function.

You must pass the list of numbers to the function largerThan along with the variable "n". The list should contain the numbers 0-10.

The function should create a new list and add to this list any numbers that are greater than "n". The largerThan function should then display all of the numbers.

At the end of the largerThan function, have a return statement that sends back the string "Done". In the main() function, print out the string sent back from the largerThan function using print().

I am stumped on this problem. We are using the latest version of Python (3.6) on Windows.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

Discuss the key ambient conditions and their effects on customers.

Answered: 1 week ago