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
Pepsi [2]
2 years ago
9

I have no idea what I’m doing but this is for a class grade and also on Replit Please Help!!

Computers and Technology
1 answer:
Tatiana [17]2 years ago
3 0

Answer:

I've compiled some code below to help you out ;)

Explanation:

# Program make a simple calculator

# This function adds two numbers

def add(x, y):

   return x + y

# This function subtracts two numbers

def subtract(x, y):

   return x - y

# This function multiplies two numbers

def multiply(x, y):

   return x * y

# This function divides two numbers

def divide(x, y):

   return x / y

print("Select operation.")

print("1.Add")

print("2.Subtract")

print("3.Multiply")

print("4.Divide")

while True:

   # take input from the user

   choice = input("Enter choice(1/2/3/4): ")

   # check if choice is one of the four options

   if choice in ('1', '2', '3', '4'):

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

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

       if choice == '1':

           print(num1, "+", num2, "=", add(num1, num2))

       elif choice == '2':

           print(num1, "-", num2, "=", subtract(num1, num2))

       elif choice == '3':

           print(num1, "*", num2, "=", multiply(num1, num2))

       elif choice == '4':

           print(num1, "/", num2, "=", divide(num1, num2))

       

       # check if user wants another calculation

       # break the while loop if answer is no

       next_calculation = input("Let's do next calculation? (yes/no): ")

       if next_calculation == "no":

         break

   

   else:

       print("Invalid Input")

I got it from this link, https://www.programiz.com/python-programming/examples/calculator

You might be interested in
Which statement is unnecessary inside the unit test for the custom controller?
Anna [14]

Answer:

A. public ExtendedController(ApexPages.StandardController cntri) { }

Explanation:

A wizard is generally referred to as the tab sequence that contains the back button as well as the next button. It usually accepts information (i.e. data) from the inputs of users from different pages of the visualfoce as well as a variable from the previous website. The statement in option A is unnecessary for the application of the custom controller.    

5 0
4 years ago
What is the full meaning of ICT
leva [86]
Information commination technology :)
6 0
4 years ago
Read 2 more answers
What is the definition of the components that motherboards, ssds, processors, and cases are part of?
iVinArrow [24]
Necessary carrying components
3 0
3 years ago
What is the name of the image window area that allows you to determine if a line is truly horizontal or vertical
kherson [118]
The answer is ruler. thank you
4 0
3 years ago
Read 2 more answers
VLSI is the process of creating an integrated circuit (IC) by combing thousands of transistors into a single chip. There are two
STatiana [176]

Answer:

The process of choosing IC technology depends upon some factors that are as follows:

  • Size of Image
  • Size of Database
  • Transformation method complexity
  • Task after Transformation step

So, by considering the given scenario, first one will be chose that is FPGA.

FPGA stands for Field Programmable Gate Array. It is preferred because it has short design cycle. Moreover while prototyping in FPGA, development kits are present which add a lot to help.

A satisfied amount of speed, power consumption and area requirements are provided by Field Programmable Gate Array FPGA.

<h2>I hope it will help you!</h2>

6 0
4 years ago
Other questions:
  • A desktop _______ produces creative digital designs with illustration software.
    12·1 answer
  • A color tv uses red, green, and blue phosphors to produce the colors that we see. in printing, however, we use magenta, yellow,
    10·1 answer
  • Answer the following questions which are based on the study "Patients' Engagement with Sweet Talk." Submit your answers to the e
    9·1 answer
  • You are using a wireless client adapter with a site survey utility and a notebook computer to perform a manual site survey in a
    7·1 answer
  • Assume v is a vector of integers that has been declared and initialized. Write a statement that adds the value 42 to the vector.
    14·1 answer
  • With respect to the five components of social media information systems (SMIS), which of the following statements is true of SM
    11·1 answer
  • Explain why it is important that software products are developed and delivered quickly. Why is it sometimes sensible to deliver
    14·1 answer
  • Multiple Choice
    9·1 answer
  • What is the best description of an unbound control?
    12·1 answer
  • each data mining technique has its advantages and limitations. which data mining technique mimics the neural structure of the br
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!