전체 글(50)
-
30분 요약 강좌 시즌2 : Python 활용편 - 섹션 2. Python-2
In [2]: #2부 #반복문(while,for), 조건문(if,elif,else) a = 1 while a 9: break a += 1 else: #break를 타지 않을 경우 print('good job') Hello world 1 Hello world 2 Hello world 3 Hello world 4 good job In [5]: l = [10,20,30,40] s = {10,20,30,40,10,10,10} d = {'one':1,'two':2} for i in l: print(i) for i in s: print(i) for i in d: #key만 순회 print(i) for i in range(10): print(i) 10 20 30 40 40 ..
2021.09.05 -
30분 요약 강좌 시즌2 : Python 활용편 - 섹션 2. Python-1
In [4]: x = 3 y = 10 print(x + y) Out[4]: 13 In [6]: #hello_world ''' hello world ''' Out[6]: '\nhello world\n' In [10]: a = 10 #int(정수) b = 10.1 #float(실수) c = 'hello world' #str(문자열) d = -1 e = 'jung' f = 'sungwook' g = 10 + 2j h = 0b1001 #int i = 0o1001 #int j = 0x1001 #int print(a + b) print(e + f) print(type(a)) # print(dir(a)) class의 ..
2021.09.05