Write a program that takes two numbers and an operator (+, -, *, /) as input. Use if-elif-else to perform the appropriate calculation and print the result.
Added by -Ngeles H.
Step 1
This function will handle user input and perform the calculations. Show more…
Show all steps
Your feedback will help us improve your experience
Liam Haas-Neill and 99 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a program with two input values. The program should display the sum, difference, quotient, product, and average of the two numbers.
Liam H.
Write a program the user must input two numbers then you print sum by calculating or adding the two numbers
Supreeta N.
Exercise Four: Write a program that inputs an integer (ask the user to enter a number). If the integer is greater than 100 or between 50 and 75 (inclusive), then output YES. Otherwise, output NO. Your program should use an if-else statement along with the && (and) and || (or) relational operators. Example: numbers that would result in an output of YES: 101, 50, 75, 55, 70, 71, 250 Example: numbers that would result in an output of NO: 49, 76, 100, 80, 10, -50, 0
Akash M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD