본문 바로가기
코딩 공부방 👩‍💻👨‍💻/알고리즘

[Python] 해커랭크(HackerRank) : Arithmetic Operators

by ByJinnie 2023. 2. 14.
반응형

[문제] 

STDIN과 계산을 연습하는 문제입니다. a와 b값이 입력되면, 이 값들의 덧셈, 뺄셈, 곱셈 결과가 출력돼야 합니다.출력은 print를 이용하면 됩니다.

 

예시)

입력값 :

3

5

 

출력값:

8

-2

15

 

[코드]

if __name__ == '__main__':
    a = int(input())
    b = int(input())
    print(a + b)
    print(a - b)
    print(a * b)

 

* 문제 출처 (Prepare > Python > Introduction > Arithmetic Operators)

: https://www.hackerrank.com/

 

HackerRank

HackerRank is the market-leading technical assessment and remote interview solution for hiring developers. Learn how to hire technical talent from anywhere!

www.hackerrank.com

 

반응형

댓글