import math
import random
def add():
return 10 + 20
print(add())
def add2(a, b):
return a + b
print(add2(1, 2))
def minus(a, b):
print(a - b)
minus(10, 5)
#전역변수 - 어디서든 사용할 수 있는 변수 "전 지역에서 사용 가능"
#지역변수 - 특정 범위에서만 쓸 수 있는 변수
def intro(name):
print(f"나는 {name}이야")
your_name = input("너의 이름은? ")
intro(your_name)
#함수 - 자료형과 관계없이 쓸 수 있는 것
#메서드 - 특정 자료형에서만 쓸 수 있는 함수
list = [1,2,3,4]
list.append(5)
print(math.pi)
print(random.randrange(1, 10))
To embed this project on your website, copy the following code and paste it into your website's HTML: