"Python 버전 2와 3 차이"의 두 판 사이의 차이

2번째 줄: 2번째 줄:
;파이썬 버전 2와 3의 차이
;파이썬 버전 2와 3의 차이


==print문 괄호 ★★==
==print문 괄호 필수 ★★==
;Python 2
<source lang='python'>
print( 'hello' )
# hello
print 'hello'
# hello
</source>
 
;Python 3
<source lang='python'>
print( 'hello' )
# hello
print 'hello'
# Error! invalid syntax
</source>


==String → Unicode로 통일 ★==
==String → Unicode로 통일 ★==

2014년 8월 21일 (목) 09:12 판

Python 2와 3의 차이
파이썬 버전 2와 3의 차이

1 print문 괄호 필수 ★★

Python 2
print( 'hello' )
# hello
print 'hello'
# hello
Python 3
print( 'hello' )
# hello
print 'hello'
# Error! invalid syntax

2 String → Unicode로 통일 ★

3 나누기 결과가 float

4 long → int로 통일

5 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}