Created
December 17, 2016 04:03
-
-
Save yunho0130/4dce24912c303125b66ff2a3c436c0a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding=utf-8 | |
# 2016-12-17 class | |
def function_test(num, val1, val2): | |
def minus(): | |
print val1 - val2 | |
def plus(): | |
print val1 + val2 | |
def muplti(): | |
print val1 * val2 | |
def division(): | |
print val1 / val2 | |
if num == 1: | |
return plus() | |
elif num == 2: | |
return minus() | |
elif num == 3: | |
return muplti() | |
elif num == 4: | |
return division() | |
def customzied_bitshift(): | |
print "비트 쉬프트 연산을 합니다." | |
val1 = int(raw_input("첫번째 수: ")) | |
val2 = int(raw_input("두번째 수: ")) | |
print "[1.덧셈 2. 뺄셈 3. 곱셈 4. 나눗셈]" | |
opt = raw_input("원하시는 연산을 입력하세요: ") | |
function_test(int(opt), val1, val2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment