Python

[Python]Code Challenge

sagesse2021 2021. 11. 19. 16:54
반응형
def plus(a, b):
  return a + b

def minus(a, b):
  return a - b

def times(a, b):
  return a * b

def division(a, b):
  return a / b

def negation(a,b):
  return -a, -b

def remainder(a,b):
  return a % b

def power(a,b):
  return a ** b

print(plus(1, 2))
print(minus(1,2))
print(times(1,2))
print(division(1,2))
print(negation(1, 2))
print(remainder(1,2))
print(power(1,2))

3

-1

2

0.5

(-1,-2)

1

1

반응형

'Python' 카테고리의 다른 글

[Python]for in 반복문  (0) 2021.11.19
[Python]if...else, elif..or/and  (0) 2021.11.19
[Python]Keyworded Arguments  (0) 2021.11.19
[Python]return  (0) 2021.11.18
[Python]함수(Function)  (0) 2021.11.18