본문 바로가기

기초언어

(92)
CSV를 2차원 인덱스로 만들어서 DATA 분석 def csv2list(filename): lists = [] file = open("C:\\Users\\ankiwoong\\PycharmProjects\\study\\더조은컴퓨터 학원 - 기초 프로그래밍\\Data\\accounts.csv", "r") while True: line = file.readline().rstrip("\n") if line: line = line.split(",") lists.append(line) else: break return lists accounts = csv2list("C:\\Users\\ankiwoong\\PycharmProjects\\study\\더조은컴퓨터 학원 - 기초 프로그래밍\\Data\\accounts.csv") print(accounts)첨부파일에 있..
Magic Commands Line magics%aliasDefine an alias for a system command.‘%alias alias_name cmd’ defines ‘alias_name’ as an alias for ‘cmd’Then, typing ‘alias_name params’ will execute the system command ‘cmd params’ (from your underlying operating system).Aliases have lower precedence than magic functions and Python normal variables, so if ‘foo’ is both a Python variable and an alias, the alias can not be execute..
Python - for 문을 활용하여 복잡한 도형 만들기 1. for문을 활용하여 복잡한 도형 만들기import turtle as t t.shape('turtle') t.speed('fastest') for i in range(400): t.forward(i) t.left(90) 2. 실행 화면
Python - for 문을 활용하여 복잡한 원 그리기 1. for문을 활용하여 복잡한 원 그리기import turtle as t n = 60 t.shape('turtle') t.speed(10) #속도 : 'fastest': 0 / 'fast': 10 / 'normal': 6 / 'slow': 3 / 'slowest': 1 for i in range(n): t.circle(120) t.right(360 / n) 2. 실행 화면
Python - 기초 원 그리기 1. Turtle 활용 기초 원 만들기import turtle as t t.shape('turtle') t.circle(100) 2. 실행 화면
Python - for 문 활용하여 다각형 만들기 1. for 문을 활용하여 다각형 만들기import turtle as t side = int(input('몇각형을 만들까요? : ')) t.shape('turtle') for i in range(side): t.forward(100) t.right(360 / side) 2. 실행화면 - 삼각형 - 사각형 - 오각형 - 육각형
Python - for 문 활용하여 정오각형 만들기 1. for문 활용하여 정오각형 만들기import turtle as t t.shape('turtle') for i in range(5): t.forward(100) t.right(72) 2. 실행 화면
Python - for 문 활용하여 정사각형 만들기 1. for 문 활용 정사격형 만들기import turtle as t t.shape('turtle') for i in range(4): t.forward(100) t.right(90) 2. 실행화면