전체 글 썸네일형 리스트형 Python 어렵게 배우기 - Exercise 27: Memorizing Logic 원문 : http://learnpythonthehardway.org/book/ex27.html Python 에서 참, 거짓 판별과 관련된 연산자(?)들andornot!= (같지 않다)== (같다)>= (크거나 같다) 더보기 Python 어렵게 배우기 - Exercise 26: Congratulations, Take a Test! 원문 : http://learnpythonthehardway.org/book/ex26.html 여태까지 공부한 내용을 가지고 위 페이지에가서 시험을 쳐 보자 더보기 Python 어렵게 배우기 - Exercise 25: Even More Practice 원문 : http://learnpythonthehardway.org/book/ex25.html 함수 사용법에 대해 더 알아보자 (ex25.py) def break_words(stuff): """This function will break up words for us.""" words = stuff.split(' ') return words def sort_words(words): """Sorts the words.""" return sorted(words) def print_first_word(words): """Prints the first word after popping it off.""" word = words.pop(0) print word def print_last_word(words): "".. 더보기 HTML, CSS 개발 툴 http://brackets.io/ 오픈 소스 개발 툴 가볍고 유용한 기능들이 많이 있는듯 하다. 일단 깔아서 써보자 더보기 Python 어렵게 배우기 - Exercise 24: More Practice 원문 : http://learnpythonthehardway.org/book/ex24.html 여태까지 배웠던것들을 다시한번 해보자 (ex24.py) print "Let's practice everything." print 'You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs.' poem = """ \tThe lovely world with logic so firmly planted cannot discern \n the needs of love nor comprehend passion from intuition and requires an explanation \n\t\twhere there is none. """ pri.. 더보기 Python 어렵게 배우기 - Exercise 23: Read Some Code 원문 : http://learnpythonthehardway.org/book/ex23.html 다양한 사람들이 작성한 python 코드를 읽어보자. 라고 하지만 쉽지 않다. 그래서 난 공부할때 예제 코드를 그대로 따라 치고 눈으로 보면서 머릿속으로실행시킨다. 그리고 실제 결과와 비교해 본다. 기계적으로 예제 코드 따라치고 실행하는거랑 차이가 날거라고 생각한다. 덧 붙여....자바 하던 버릇 때문에 함수명이나 변수명을 getCurrentUsers() 뭐 이런식으로 이름 붙이는데...get_current_users() 이런식으로 하는게 맞는거 같다.뭐 법으로 정해진건 아닌데좀더 파이썬 스럽달까? 그런 느낌을 내기위해 많이들 사용하는 방법을 사용하자. 더보기 Python 어렵게 배우기 - Exercise 22: What Do You Know So Far? 원문 : http://learnpythonthehardway.org/book/ex22.html 지금의 과정이 힘들고 어렵지만 꾸준히 성실하게 나아간다면 니가 원하는 세상의 냄새를 맡을 수 있을거야 더보기 Python 어렵게 배우기 - Exercise 21: Functions Can Return Something 원문 : http://learnpythonthehardway.org/book/ex21.html 결과값을 돌려주는 함수의 기능에 대해 공부해보자(ex21.py) def add(a, b): print "ADDING %d + %d" % (a, b) return a + b def subtract(a, b): print "SUBTRACTING %d - %d" % (a, b) return a - b def multiply(a, b): print "MULTIPLYING %d * %d" % (a, b) return a * b def divide(a, b): print "DIVIDING %d / %d" % (a, b) return a / b print "Let's do some math with just function.. 더보기 이전 1 ··· 11 12 13 14 15 16 17 ··· 26 다음