1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vovikov84 [41]
3 years ago
12

White a function the will accept three arguments, two numbers and an operation sign among "+", "-", "/", and "x". The function s

hould apply the operation on the two numbers and return the result to the caller. This is a basic calculator.
Computers and Technology
1 answer:
Setler79 [48]3 years ago
4 0

Answer:

Here you go :)

Explanation:

Change this however you'd like:

def calc(n1, op, n2):

   if op.lower() == "x":

       return n1*n2

   elif op == "+":

       return n1+n2

   elif op == "-":

       return n1-n2

   elif op == "/":

       return n1/n2

   else:

       return "error"

num1 = float(input("Input first number: "))

oper = input("Input operator: ")

num2 = float(input("Input second number: "))

print(calc(num1, oper, num2))

You might be interested in
What is MARC? Discuss structure of MARC
nordsb [41]
What do you mean? I don't understand.
7 0
3 years ago
If necessary, create a new project named Advanced19 Project, and save it in the Cpp8\Chap06 folder. Enter (or copy) the instruct
Digiron [165]

Answer:  If a customer orders more than four pizzas, the program should deduct 10% from the cost of the order. Modify the program appropriately, and then save, run, and test it.

4 0
3 years ago
Consider an online shopping portal that allows a customer to browse and purchase different products. The products are arranged u
o-na [289]
Way too much to read bye
7 0
3 years ago
Read 2 more answers
In this activity, you will submit the work you completed for the "Explore: Products" assignment. Type your response directly int
BabaBlast [244]

It should be noted that mate is the national beverage of countries such as Uruguay, Paraguay, and Argentina.

<h2>What is mate?</h2>

Mate tea is simply a beverage that is high in antioxidants and also contains caffeine.

It should be noted that mate is important as it raises morale, helps in sustaining the muscular system, and also allows an individual endure privations.

In conclusion, the drink is also usually taken by sportsmen.

Learn more about beverages on:

brainly.com/question/25884013

6 0
2 years ago
Write a program in pascal to solve a quadratic equation
GalinKa [24]
Program p1;
var a,b,c,d : integer; {i presume you give integer numbers for the values of a, b, c }
     x1, x2 : real;
begin 
write('a='); readln(a);
write('b='); readln(b);
write('c=');readln(c);
d:=b*b - 4*a*c
if a=0 then x1=x2= - c/b
          else
if d>0 then begin 
                 x1:=(-b+sqrt(d)) / (2*a);
                 x2:=(-b - sqrt(d))/(2*a);
                end;
          else if d=0 then x1=x2= - b /(2*a)
                           else write ("no specific solution because d<0");
writeln('x1=', x1);
writeln('x2=',x2);
readln;
end.
5 0
3 years ago
Other questions:
  • Which best describes the benefits of renting a home?
    10·2 answers
  • Which social networking site became a gaming platform after 2009?
    6·2 answers
  • When using Regedit to browse through the registry, the key that is highlighted is the ________, and its value entries are visibl
    5·1 answer
  • For the following C code assume k and m are passed in x3 and x4 respectively, while result is returned in x4. Compile this code
    14·1 answer
  • Describe the importance of human interaction in a computing system.
    14·2 answers
  • What are the advantages of customer relationship managment​
    10·1 answer
  • If you have 60fps on your laptop tell me one way you can go to 240fps
    14·2 answers
  • Which coding term means to carry out a series of steps one after another?
    7·2 answers
  • What is Fill handle?
    12·1 answer
  • You are the security analyst for your organization and have discovered evidence that someone is attempting to brute-force the ro
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!