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
Help please, on tuesday we have oral presentation in zoom and i am afraid to speak in front of people, and i don't know what to
Lapatulllka [165]

Answer:

You should be strong, and be sure about what you want to say. Make sure when you speak it is clear, and makes sense.

Explanation:

If you don't speak up or sound like you know what you are talking about. I like to think of it as dancing. Act like you own the stage, or in your case, like you own the presentation. Also, I suggest you speak to your teacher in private, about him ignoring you. If I were you, I would look for newer friends. Ones that won't ignore you.

6 0
3 years ago
What does the octal number 362 represent in the decimal system?
kykrilka [37]
The answer is E. 242
8 0
3 years ago
(within 200 words) analyzing the importance of information and communication technology in personal life.
Volgvan

Explanation:

Information technology is inescapable in modern day life, turn on the coffee pot and there are tiny microprocessor inside. Start your automobile and every aspect of operation is controlled by dozens of computer control modules. The current mobile phone amazing power and speed for the user. Technology is transforming every aspect of our life. Nowever is this more apparent than our place of employment. Developing of it makes our family to live happy because it helps the members of family to spend their most time with their family. It helps us to communicate the family member who live far from their family. It is also used in house hold work. It's saves our time to do more better and better

6 0
3 years ago
You have a small business.Due to the recent pandemic you seem to be losing contacts with your suppliers and customers.You want t
Brilliant_brown [7]

Answer:

You can use social media to advertise your product or service you don’t need to work to pay your employees insted create content as a way to help your business grow/expand.

Explanation:

Social media is a big platform and you can eventually find new potential clients and you can benefit yourself instead of paying someone

8 0
3 years ago
A nonlinear optimization problem is any optimization problem in which at least one term in the objective function or a constrain
MAXImum [283]

Answer:

Yes

Explanation:

A nonlinear optimization problem is indeed a optimization problem in which there are nonlinear elements involved either as the objective function or one or more constraints may be nonlinear also. Let me show you an example. Let optimize de following function:

f(x) = x_{1} +x_{2}

These are the constraints:

x_{1} \geq  0\\x_{2} \geq  0\\\\x_{1} ^{2} +  x^{2}_{2}  \geq  1

The last constraint consists on nonlinear elements, so this problem in fact a nonlinear optimization problem.

5 0
3 years ago
Other questions:
  • ________ employs state-of-the-art computer software and hardware to help people work better together.
    13·1 answer
  • HELP ME!!!!!!!!!!!!
    14·1 answer
  • A specific remote device with a fixed IP address must be able to access your computer across the network. It must be able to acc
    15·2 answers
  • To pinpoint an earthquake's location, scientists need information from how many seismometers?
    8·1 answer
  • According to the chart, which degree would you have to earn in order to make the most amount of money? A bar graph titled Averag
    13·2 answers
  • The ________ is the heart of the operating system and controls its most critical processes.
    9·1 answer
  • In order to recover from an attack on any one server, it would take an estimated 14 hours to rebuild servers 1, 2, 3, and 4 and
    6·1 answer
  • : how do network effects help facebook fend off smaller social-networking rivals?
    7·1 answer
  • What is the ribbon used for in word
    9·1 answer
  • I need help with this question!!
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!