본문 바로가기

흰둥이는 코드를 짤 때 짖어 (왈!왈!왈!왈!왈!왈!왈!왈!왈!왈!왈!)

검색하기
흰둥이는 코드를 짤 때 짖어 (왈!왈!왈!왈!왈!왈!왈!왈!왈!왈!왈!)
프로필사진 흰둥아솜사탕

  • 분류 전체보기 (132)
    • 파이썬 기초 (29)
    • MySQL (14)
    • HTML, CSS, JS (39)
    • Node.js (2)
    • 파이썬 데이터 분석 (13)
    • 파이썬 크롤링 (4)
    • 파이썬 머신러닝, 딥러닝 (17)
    • 과제 (11)
    • 시험 (3)
Guestbook
250x250
Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags
  • __getitem__
  • JS
  • discard()
  • fileinput
  • shutil
  • View
  • zipfile
  • mro()
  • CSS
  • shuffle()
  • remove()
  • inplace()
  • MySQL
  • HTML
  • Database
  • fnmatch
  • items()
  • glob
  • __annotations__
  • locals()
  • choice()
  • randrange()
  • MySqlDB
  • 파이썬
  • count()
  • node.js
  • __len__
  • decode()
  • __sub__
  • 오버라이딩
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록locals() (1)

흰둥이는 코드를 짤 때 짖어 (왈!왈!왈!왈!왈!왈!왈!왈!왈!왈!왈!)

(파이썬) 변수의 범위

1. 스코프(scope) 변수의 접근할 수 있는 범위 local: 가장 가까운 함수안의 범위 global: 함수 바깥의 변수 또는 import된 module In [1]: num1 = 10 # 글로벌 변수 def func1(): num2 = 20 # 로컬 변수 print(num2) In [2]: print(num1) print(num2) # NameError: name 'num2' is not defined 10 --------------------------------------------------------------------------- NameError Traceback (most recent call last) in 1 print(num1) ----> 2 print(num2) NameErro..

파이썬 기초 2023. 3. 9. 12:36
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바