Problem 2: Basic Calculator
Easypython
Learn the Concept: Python BasicsProblem Description
Write a Python program that takes two numbers as input and prints their sum, difference, product, and quotient.
Input
Two numbers, entered one at a time.
Output
Four lines showing the sum, difference, product, and division result (in that order).
Constraints
- The second number will not be zero.
Example Input
text10 5
Example Output
textSum: 15 Difference: 5 Product: 50 Quotient: 2.0
Concepts Covered
input(), type conversion, arithmetic operators, print().
Related Problems
- Problem 1: Simple Greeting ProgramEasy · pythonSolve Problem
- Problem 3: Remainder and Floor Division CheckerEasy · pythonSolve Problem
- Problem 4: Comment-the-Code ExerciseEasy · pythonSolve Problem