Python/Python 어렵게 배우기
Python 어렵게 배우기 - Exercise 2: Comments and Pound Characters
purepleya
2013. 11. 18. 18:45
원문 : http://learnpythonthehardway.org/book/ex2.html
1. 텍스트 에디터로 아래와 같이 작성하고 ex2.py로 저장하자
# A comment, this is so you can read your program later. # Anything after the # is ignored by python. print "I could have code like this." # and the comment after is ignored # You can also use a comment to "disable" or comment out a piece of code: # print "This won't run." print "This will run."
2. 실행해 보자 (python ex2.py)
알 수 있는 것들...
1. 주석을 입력하고 싶으면 "#"를 붙여서 입력하면 된다.
2. 그럼 "# -*- coding: utf-8 -*-" 이건? >> 일종의 "hack" 이다.
반응형