앞에 건 어딨나요? 묻지 마세요.
튜토리얼이라 뺐어요..
3. 설치 및 실행
Python 3 설치
Visual Studio Code
코드를 편집하는 도구
주피터 노트북은 글 중간에 코드를 심어서 실행할 수 있도록 한다. 이것을 설치하지 않고 온라인에서 할 수 있도록 만들 것이 있다. 바로...!
Colaboratory
구글 드라이브 - 더보기. 이 과정을 통해 이용 가능하다.
Ideone
파이썬뿐만 아니라 다양한 언어를 사용할 수 있다.
짧은 TIP..
티스토리에 코드블록 집어넣는 방법
1. 티스토리 자체 코드블록 사용 - but. 색상이 적어서 가독성이 떨어진다.
2. https://colorscripter.com/ 사용 - html 모드에서 링크를 복사한 후 기본모드로 돌아오면 된다.
4. 데이터타입
문자열데이터타입
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
print('hello world')
print("Hello World")
print('''
Hello
World
''')
print("""
I'm
Yoon!
""")
print("'1'+'1'", '1'+'1')
print('rich man'*100)
print("len('rich man'*100)", len('rich man'*100))
print("'rich man'.replace('rich', 'kind')", 'rich man'.replace('rich', 'kind'))
|
cs |
리스트 데이터 타입
1
2
3
4
5
6
7
8
9
10
11
12
13
|
students = ["egoing", "sori", "maru"]
grades = [2,1,4]
print("students[1]", students[1])
print("len(students)", len(students))
print("min(grades)", min(grades))
print("max(grades)", max(grades))
print("sum(grades)", sum(grades))
import statistics
print("statistics.mean(grades)", statistics.mean(grades))
import random
print("random.choice(students)", random.choice(students))
|
cs |
5. 메뉴얼과 검색
파이썬 홈페이지에서 볼 수 있는 세 가지!
Tutorial
Library Reference
Language Reference
무언가 궁금한 것이 생겼다면 구글에 검색하면 된다.
"python random"
6. 변수
변수는 데이터에 이름을 붙이는 것이다.
변수에 이름을 잘 붙이면 수정하기도 쉽고, 다른 사람과 소통하기 수월해진다.
1
2
3
4
5
6
7
8
9
|
price = 1000
vat_rate = 0.1
vat = price * vat_rate
print(vat)
print("(vat)", (vat))
name = 'sori'
message = 'hi, '+name+' .... bye, '+name+'.'
print(message)
|
cs |
7. 디버깅
오타는 당대에 발견되지 않는다.
코딩은 정신적으로 고독한 일이다.
행복한 에러는 문법 오류이다.
불행한 에러는 논리 오류이다.
디버거 debugger
파이썬 에디터마다 각 디버거가 있다.
오류 찾는 도구를 잘 쓰자
8. 입력과 출력
name = input('name: ')
9. pypi pip
pandas 와 같은 소프트웨어를 pypi에서 pip로 다운로드 받아서 무궁무진하게 활용할 수 있다.
import pandas
house = pandas.read_csv('house.csv')
print(house)
print(house.head(2))
print(house.describe())
공부시작: 23.11.27
공부종료: 23.11.29
Studying Source: https://www.opentutorials.org/course/4769
'Programming > Python' 카테고리의 다른 글
점프 투 파이썬 (4) 제어문 If - While - For (2) | 2023.12.02 |
---|---|
점프 투 파이썬 (3) 자료형, 변수 (3) | 2023.12.02 |
점프 투 파이썬 (2) 기초, 자료형 (2) | 2023.12.01 |
점프 투 파이썬 (1) 파이썬이란 무엇인가? (2) | 2023.11.30 |
생활코딩 X PYTHON_3 - function, module, package (0) | 2023.11.29 |