티스토리 뷰
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
-. 변경가능 변수
>>> def sum1(x,y):
return x + y
>>> sum1(2,3)
5
>>> def ch(x):
x[0] = 'H'
>>> wordlist = ['J','A','M']
>>> wordlist
['J', 'A', 'M']
>>> ch(wordlist)
>>> wordlist
['H', 'A', 'M']
-. 변경불가능 변수
>>> def sum2 (x,y):
x = 1
return x + y
>>> sum2(2,3)
4
>>> def ch(x):
x = x[:]
x[0] = 'H'
return None
>>> wordlist = ['J','A','M']
>>> wordlist
['J', 'A', 'M']
>>> ch(wordlist)
>>> wordlist
['J', 'A', 'M']
'Python' 카테고리의 다른 글
Python, 함수_인수 (0) | 2016.04.21 |
---|---|
Python, 함수_스코핑룰 (0) | 2016.04.21 |
Python, 함수 (0) | 2016.04.21 |
Python, 복사 (0) | 2016.04.21 |
Python, 부울 (0) | 2016.04.21 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- IdClass
- Python
- highlightbackground
- 폼
- 상수
- indicatoron
- activeforeground
- Linux
- apache
- disabledforeground
- Module
- 리눅스
- borderwidth
- fetch join
- Private
- 파이썬
- JPA
- checkbutton
- command
- onetomany
- tkinter command & bind [명령어묶기와 사건묶기] Python
- FetchType
- Excel
- tkinter
- Composite Key
- vba
- highlightthickness
- Java
- activebackground
- ManyToOne
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함