전체 글 썸네일형 리스트형 Python 어렵게 배우기 - Exercise 5: More Variables and Printing 원문 : http://learnpythonthehardway.org/book/ex5.html 아래와 같이 작성 하자 (ex5.py) my_name = 'Zed A. Shaw' my_age = 35 # not a lie my_height = 74 # inches my_weight = 180 # lbs my_eyes = 'Blue' my_teeth = 'White' my_hair = 'Brown' print "Let's talk about %s." % my_name print "He's %d inches tall." % my_height print "He's %d pounds heavy." % my_weight print "Actually that's not too heavy." print "He's got.. 더보기 Python 어렵게 배우기 - Exercise 4: Variables And Names 원문 : http://learnpythonthehardway.org/book/ex4.html 변수에 대해서 공부해 보자 일단 아래와 같이 작성해보자 cars = 100 space_in_a_car = 4.0 drivers = 30 passengers = 90 cars_not_driven = cars - drivers cars_driven = drivers carpool_capacity = cars_driven * space_in_a_car average_passengers_per_car = passengers / cars_driven print "There are", cars, "cars available." print "There are only", drivers, "drivers available." .. 더보기 Python 어렵게 배우기 - Exercise 3: Numbers and Math 원문 : http://learnpythonthehardway.org/book/ex3.html python에서 사용되는 수학 연산자들은 아래와 같다.+ plus : 더하기- minus : 빼기/ slash : 나누기* asterisk : 곱하기% percent : 나머지 greater-than : ~보다 크다= greater-than-equal : ~보다 크거나 같다. 아래와 같이 작성하고 ex3.py로 저장한다. print "I will now count my chickens:" print "Hens", 25 + 30 / 6 print "Roosters", 100 - 25 * 3 % 4 print "Now I will count the eggs:" print 3 + .. 더보기 Python 어렵게 배우기 - Exercise 2: Comments and Pound Characters 원문 : 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. 실행해 보자 (p.. 더보기 Python 어렵게 배우기 - Exercise 1: A Good First Program 원문 : http://learnpythonthehardway.org/book/ex1.html Exercise 0 단계 는 세팅이라 패스. 1. 텍스트 에디터(Notepad, EditPlus, ...)로 아래와 같이 작성한다. # -*- coding: utf-8 -*- #Unicode UTF-8을 사용하고 싶다면 위 코드를 코드 맨 위에 작성한다. print "Hello World!" print "Hello Again" print "I like typing this." print "This is fun." print 'Yay! Printing.' print "I'd much rather you 'not'." print 'I "said" do not touch this.' 2. ex1.py 파일로 저장한다... 더보기 Microsoft Virtual Academy http://www.microsoftvirtualacademy.com/ C# 공부하기 좋은 사이트 더보기 Pingendo - Bootstrap 기반 프로토타입 제작 프로그램 레이아웃 작업을 편리하게 해주는 tool http://www.pingendo.com/ 더보기 Google Web Designer http://www.google.com/webdesigner/ 더보기 이전 1 ··· 14 15 16 17 18 19 20 ··· 26 다음