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
Which section of a personal narrative requires the most development
attashe74 [19]
D. Plot because a,b,and c is consider plot can i have brainlest answer please

5 0
4 years ago
Refer to the image below. The portion of the letter labeled 5. is the ___________________
Salsk061 [2.6K]

Refer to the image below.

WHERE IS THE IMAGE!!!!

6 0
3 years ago
Read 2 more answers
The process of searching for a special pattern of symbols within a larger collection of information is called pattern ____.
tatuchka [14]

Answer:

Pattern Matching

Explanation:

Pattern matching in computer science is defined as the analysing & finding specific sequences of data of some pattern among raw data or a sequence of tokens.

4 0
3 years ago
Paige is writing about the progress her team made in setting up a new software system. in one detail, she tells that the team co
jenyasd209 [6]

Answer:

Also

Explanation:

Just checked it in the system

3 0
3 years ago
Read 2 more answers
A database planner names a field “Organic ingredients_3”. Why would this name Create possible problems in programming?
o-na [289]

Answer:

I think the answer is 2.

hope it will help you

4 0
3 years ago
Read 2 more answers
Other questions:
  • Declare an array reference variable, week, and initialize it to an array containing the strings "mon", "tue", "wed", "thu", "fri
    15·1 answer
  • A 10MB file is compressed into a 2MB file for storage. What is the compression ratio?
    6·1 answer
  • The user can set their own computer hostname and username. Which stage of the hardware lifecycle does this scenario belong to?
    6·1 answer
  • How do you make Thumbnails and outros on Youtube for free?
    8·1 answer
  • The Many–Hands Problem makes it difficult to determine who should be held accountable for mistakes since:
    7·1 answer
  • Need help with photography
    12·1 answer
  • True or false.local and cloud backup differs in where the backup is saved
    15·2 answers
  • Identify the programming language released by
    10·1 answer
  • I will mark Brainliest if you sub to Huggablesheep 89 he said he is going to quit if he gets 50 subs he might try again please h
    8·2 answers
  • To generate a series of first ten counting number of algorithm​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!