[파이썬] 함수
함수1 # 함수 # define def function_name(): print('myfunction') function_name() 결과 myfunction 함수2 # function argument def myfn1(): print('myfn1') def myfn2(arg1): print(arg1) def myfn3(arg1 = 'a', arg2 = 'b'): print(arg1, arg2) def myfn4(*arg1): for i in arg1: print(i) def myfn5(arg1, *, arg2, arg3): print(arg1, arg2, arg3) def myfn5(arg1, *, arg2, arg3): print(arg1, arg2, arg3) def myfn6(arg1, /, ar..
[파이썬] list, tuple, set, dictionary
# list, tuple. set, dictionary list1 = [1, 2, 3, 4] print(list1) print(type(list1)) list2 = [1, 10.5, 'abc', False, [1, 2, 3, 4]] print(list2) tuple1 = (1, 2, 3, 4) print(tuple1) print(type(tuple1)) set1 = {1, 2, 3, 4, 4, 5, 5, 5} print(set1) list2 = [1, 2, 3, 4, 4, 5, 5, 5] print(list2) d1 = {'a' : 1, 'b' : 2, 'c' : 3} print(d1) print(type(d1)) 결과 [1, 2, 3, 4] [1, 10.5, 'abc', False, [1, 2, 3, ..