Arithmetic Operators | HackerRank
Arithmetic Operators | HackerRank
Addition, subtraction and multiplication.
www.hackerrank.com
Goal
1. Read two integers from STDIN.
2. Solve tasks to use arithmetic operators.

Solution
You can read values by using input() function. The important thing is to convert input() value into integer type because Input() function returns string value from input.
After read two integer values, you can calculate vaules for each task.
# Arithmetic Operators
if __name__ == '__main__':
a = int(input())
b = int(input())
sum = a + b
difference = a - b
product = a * b
print(sum)
print(difference)
print(product)'software Engineering > (Python)HackerRank' 카테고리의 다른 글
| [Python] HackerRank - Write a function (0) | 2023.01.26 |
|---|---|
| [Python] HackerRank - Loops (0) | 2023.01.21 |
| [Python] HackerRank - Python: Division (0) | 2023.01.20 |
| [Python] HackerRank - Python If-Else (0) | 2023.01.19 |
| [Python] HackerRank - Say "Hello, World!" With Python (0) | 2023.01.19 |
