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
Artyom0805 [142]
3 years ago
8

Write a python code for a calculator

Computers and Technology
2 answers:
Bingel [31]3 years ago
8 0

Answer:

In this example you will learn to create a simple calculator that can add, subtract, multiply or divide depending upon the input from the user.

Explanation:

SIZIF [17.4K]3 years ago
4 0
I am sure you are using an editor but if doesn’t work you can search online python compiler .

Answer :

We know that a calculater should be able to calculate ( addition , subs traction, multiplication, division …etc)

# first takng inputs
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))

# operations
print("Operation: +, -, *, /")
select = input("Select operations: ")

# check operations and display result
# add(+) two numbers
if select == "+":
print(num1, "+", num2, "=", num1+num2)

# subtract(-) two numbers
elif select == "-":
print(num1, "-", num2, "=", num1-num2)

# multiplies(*) two numbers
elif select == "*":
print(num1, "*", num2, "=", num1*num2)

# divides(/) two numbers
elif select == "/":
print(num1, "/", num2, "=", num1/num2)

else:
print("Invalid input")
You might be interested in
Choose the correct term to complete the sentence.
Rashid [163]

Answer:

Epoch

Explanation:

5 0
3 years ago
On the cities worksheet, click cell f4 and enter a formula that will subtract the departure date (b1) form the return date (b2)
Mademuasel [1]
=(+B2-B1)*F3 is what you need to enter in cell F4
8 0
3 years ago
Your company is experiencing an increase in malware incidents. Your manager is asking for advice on how best to verify that comp
dexar [7]

Answer:

c.

Explanation:

Based on the information provided within the question it can be said that the best option in this scenario would be to implement an endpoint management server appliance. This is a software or dedicated appliance that is used in order to discover, manage, and control any and all computer devices that are trying to access the corporate network. This allows you to remove individuals as well as administrative rights from those trying to connect or that are already connected.

5 0
4 years ago
PLSS HELP ASAP ILL GIVE BRAINLIEST THANKS
Svet_ta [14]
Second one i’m pretty sure
3 0
2 years ago
Divide Rs60 in the ratio 1:4​
DanielleElmas [232]

Answer on the attachment

3 0
3 years ago
Other questions:
  • Which internet explorer 11 feature enables it to correctly display pages that were developed using older technologies?
    14·1 answer
  • Dillion’s company has decided it wants to find a way to do a better job of tracking clothing inventories. Dillon has been asked
    5·1 answer
  • Maria is starting a pet hotel and needs a website to promote her business and establish her brand. Which of the following is the
    13·1 answer
  • Companies expose themselves to harsh sanctions by federal agencies when they violate the privacy policies that their customers r
    8·1 answer
  • Of the following choices what was the best thing to do with electronic equipment you no longer want
    7·1 answer
  • 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
    6·1 answer
  • Data bars are a form of ________.
    8·2 answers
  • Which requires large computer memory?
    15·1 answer
  • I still need help, thank you! Will give Brainliest ​
    10·1 answer
  • Which statement best describes how the programming layer of abstraction in
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!