-
# Python Challenge Day 4Python 2024. 3. 22. 00:13728x90
사칙연산 구현하기
playing = True while playing: a = int(input("Choose a number:\n")) b = int(input("Choose another one:\n")) operation = input( "Choose an operation:\n Options are: + , - , * or /.\n Write 'exit' to finish.\n" ) if operation == "+": print("Result: ", a + b) elif operation == "-": print("Result: ", a - b) elif operation == "*": print("Result: ", a * b) elif operation == "/": print("Result: ", a / b) elif operation == "exit": playing = False
728x90'Python' 카테고리의 다른 글
# Python Challenge Day 6 (0) 2024.03.25 # Python Challenge Day 5 (0) 2024.03.23 # Python Challenge Day 3 (0) 2024.03.21 # Python Challenge Day 2 (0) 2024.03.20 # Python Challenge Day 1 (0) 2024.03.18