A Byte Of Python 번역본을 보고 공부를 해보자 인터넷을 통한 지식의 공유 정신을 통하여 오픈 소스, 오픈 콘텐즈와 오픈 교육이 활성화 될 수 있었다. 삶에 있어 성공이라고 하는 것은 재능과 요행보다는 집중력과 참을성에 달려 있습니다.(Success in life is a matter not so much of talent and opportunity as of concentration and perseverance.-C.W.Wendte) 파이썬이라는 이름의 유래는 파이쎤의 창시자 귀도 반 로섬(Guido van Rossum)이 BBC에서 방영되던 "Monty Python's Flying Circus"라는 TV 프로그램의 이름을 따서 지었습니다.In [8]:# 첫번째 python 프로그램pri..
In [11]: class Vec: def __init__(self, labels, function): self.D=labels self.f=functionv=Vec(['A', 'B', 'C'], {'A':1})for d in v.D: if d in v.f: print(v.f[d])def zero_vec(D): return Vec(D, {d:0 for d in D})d={1,2,3,4,5,6,7,8}dp = zero_vec(d)print(dp) 1 In [34]: class Vec: def __init__(self, labels, function): self.D=labels self.f=functionv=Vec(['A', 'B', 'C'], {'A':1})def setitem(v, d, val) ..
Charpter3. Vector In [8]: import maths=[3.14159, 2.718281828, -1.0, 2.0]e=list(enumerate(s))print(e) [(0, 3.14159), (1, 2.718281828), (2, -1.0), (3, 2.0)] In [11]: list(zip([1,2,3,4], [1,2,3,4])) Out[11]: [(1, 1), (2, 2), (3, 3), (4, 4)] In [14]: %matplotlib inlineimport numpy as npimport matplotlib.pyplot as pltlimit=4s=[2+2j, 3+2j, 1.75+1j, 2+1j, 2.25+1j, 2.5+1j, 2.75+1j, 3+1j, 3.25+1j]for x i..