Question

Python Jupyter Notebook

Write a python **function** called
**profit** that takes the number of meals
(**n**) sold by a restaurant in a month and calculates
the monthly profit given the following information: The selling
price of each meal is 12 USD (same for all meals) There is a fixed
cost of 2500 USD per month regardless of the number of meals sold.
There is a variable cost of 6 USD per each meal sold profit= total
revenue- total cost = 12n - (2500 + 6n)

Now write a program that takes the number of meals sold in a
given month from user and shows the monthly profit by calling the
**profit** function.

Example:

How many meals did you sell last month?:1400

Your profit last month were 5900 USD

Answer #1

Python code:

#defining profit function

def profit(n):

#returning the profit

return 12*n-(2500+6*n)

#accepting number of meals sold

n=int(input("How many meals did you sell last month?:"))

#calling profit function and printing the profit obtained

print("Your profit last month were "+str(profit(n))+" USD")

Screenshot:

Input and Output:

Python Jupyter Notebook
Write a program that prompts the user to enter his/her first
name, last name, and year of birth in a single string (in the
format: fn;ln;yyyy), then calculates the age tell
it to him/her after greeting him/her using the first name.
Make sure to capitalize the user's first name, regardless of how
he/she typed it in.
Hint: review Exercise 1!
Example:
Enter your first name, last name, and birth year (in format
fn;ln;yyyy): alex;smith;1994
Hi Alex, you...

Python: Write a recursive function that takes in a number as a
parameter and calculates the square of the number up to and
including the value of the parameter.

PYTHON: Write a function that takes in a number as a parameter
and calculates the square of the number up to and including the
value of the parameter. The function must perform the process
recursively.

Python: Write a function that takes in a number as a parameter
and calculates the square of the number up to and including the
value of the parameter. Please use a while or for loop.

Write a Python function evaluateFunction() that takes one
floating point number x as its argument and returns 3√(log|x|
)+3(x^3) The math module has a square root function and a logarithm
function

MATHEMATICS
1. The measure of location which is the most likely to
be
influenced by extreme values in the data set is the a. range
b.
median c. mode d. mean
2. If two events are independent, then a. they must be
mutually
exclusive b. the sum of their probabilities must be equal to one
c.
their intersection must be zero d. None of these alternatives
is
correct. any value between 0 to 1
3. Two events, A and B,...

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 2 minutes ago

asked 5 minutes ago

asked 9 minutes ago

asked 22 minutes ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 2 hours ago

asked 2 hours ago

asked 2 hours ago

asked 2 hours ago