2024. 7. 30. 15:59ㆍ프로그래밍 언어/Python
1. 변수와 자료형
- 변수: 값을 저장
- 예시: age = 25, name = "Alice"
- 출처: 파이썬 공식 문서 - 3. Data model https://docs.python.org/3/reference/datamodel.html
- 자료형: 변수에 저장되는 값의 타입
- 숫자형 (int, float), 문자열 (str), 불린형 (bool), 튜플 (tuple), 리스트 (list), 딕셔너리 (dict) 등
- 출처: 파이썬 공식 문서 - 3. Data model (https://docs.python.org/3/reference/datamodel.html)
3. Data model
Objects, values and types: Objects are Python’s abstraction for data. All data in a Python program is represented by objects or by relations between objects. (In a sense, and in conformance to Von ...
docs.python.org
2. 연산자
- 산술 연산자: 덧셈 (+), 뺄셈 (-), 곱셈 (*), 나눗셈 (/), 나머지 (%), 거듭제곱 (**) 등
- 예시: 10 + 3, 10 * 3, 10 / 3, 10 % 3, 10 ** 3
- 출처: 파이썬 공식 문서 - 6. Expressions https://docs.python.org/3/reference/expressions.html
- 비교 연산자: 같음 (==), 다름 (!=), 크다 (>), 작다 (<), 크거나 같다 (>=), 작거나 같다 (<=)
- 예시: 10 == 10, 10 != 3, 10 > 3, 10 < 3
- 출처: 파이썬 공식 문서 - 6. Expressions https://docs.python.org/3/reference/expressions.html
- 논리 연산자: and, or, not
- 예시: True and False, True or False, not True
- 출처: 파이썬 공식 문서 - 6. Expressions https://docs.python.org/3/reference/expressions.html
6. Expressions
This chapter explains the meaning of the elements of expressions in Python. Syntax Notes: In this and the following chapters, extended BNF notation will be used to describe syntax, not lexical anal...
docs.python.org
3. 조건문 (if, else, elif)
- if: 조건이 참일 때 실행할 코드를 지정.
- else: if 조건이 거짓일 때 실행할 코드를 지정.
- elif: 여러 개의 조건을 순차적으로 검사.
- 예시:
if score >= 90:
print("Excellent!")
elif score >= 80:
print("Good!")
else:
print("Study harder!")
https://docs.python.org/3/tutorial/controlflow.html
4. More Control Flow Tools
As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. if Statements: Perhaps the most well-known statement type is the if statement. For exa...
docs.python.org
4. 반복문 (for, while)
- for: 정해진 횟수만큼 반복 실행.
- 예시: for i in range(5): print(i)
- 출처: 파이썬 공식 문서 - 4. More Control Flow Tools (https://docs.python.org/3/tutorial/controlflow.html)
- while: 조건이 참인 동안 반복 실행.
- 예시:
count = 0
while count < 5:
print(count)
count += 1
https://docs.python.org/3/tutorial/controlflow.html
4. More Control Flow Tools
As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. if Statements: Perhaps the most well-known statement type is the if statement. For exa...
docs.python.org
5. 함수
- 함수: 특정 작업을 수행하는 코드 블록.
- 예시:
def greet(name):
print("Hello,", name)
greet("Alice")
https://docs.python.org/3/tutorial/controlflow.html
4. More Control Flow Tools
As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. if Statements: Perhaps the most well-known statement type is the if statement. For exa...
docs.python.org
6. 리스트
- 리스트: 여러 개의 값을 순서대로 저장하는 자료형.
- 예시: numbers = [1, 2, 3, 4, 5], names = ["Alice", "Bob", "Charlie"]
- 출처: 파이썬 공식 문서 - 5. Data Structures https://docs.python.org/3/tutorial/datastructures.html
5. Data Structures
This chapter describes some things you’ve learned about already in more detail, and adds some new things as well. More on Lists: The list data type has some more methods. Here are all of the method...
docs.python.org
7. 튜플
- 튜플: 여러 개의 값을 순서대로 저장하는 자료형. 변경 불가능.
- 예시: coordinates = (37.5665, 126.9780), colors = ("red", "green", "blue")
- 출처: 파이썬 공식 문서 - 5. Data Structures https://docs.python.org/3/tutorial/datastructures.html
5. Data Structures
This chapter describes some things you’ve learned about already in more detail, and adds some new things as well. More on Lists: The list data type has some more methods. Here are all of the method...
docs.python.org
8. 딕셔너리
- 딕셔너리: 키-값 쌍으로 데이터를 저장하는 자료형.
- 예시:
person = {
"name": "Alice",
"age": 25,
"city": "Seoul"
}
https://docs.python.org/3/tutorial/datastructures.html
5. Data Structures
This chapter describes some things you’ve learned about already in more detail, and adds some new things as well. More on Lists: The list data type has some more methods. Here are all of the method...
docs.python.org
9. 프로그래밍 언어는 기반이 되는 언어를 익힌 이후에는 공통되는 내용이 많기 때문에 다른 언어를 배우기는 쉬워지는 경향이 있습니다. (물론 절차지형, 객체지향, 함수형 언어 등.. 언어의 특징에 따라 차이는 사고에 변화가 좀 필요합니다만..)
참고용 사이트 정리
1. 파이썬 공식 문서 (초보자 튜토리얼): https://docs.python.org/3/tutorial/index.html
The Python Tutorial
Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax an...
docs.python.org
2. 코드카데미 (Codecademy): https://www.codecademy.com/learn/learn-python-3
Learn Python 3 | Codecademy
Develop your Python 3 skills in our comprehensive course. Start coding and build versatile applications.
www.codecademy.com
3. 생활코딩: https://opentutorials.org/course/1
생활코딩
hello world 생활코딩의 세계에 오신 것을 환영합니다. 생활코딩은 일반인들에게 프로그래밍을 알려주는 무료 온라인, 오프라인 수업입니다. 어떻게 공부할 것인가를 생각해보기 전에 왜 프로그
opentutorials.org
4. 인프런: https://www.inflearn.com/courses?s=%ED%8C%8C%EC%9D%B4%EC%8D%AC
파이썬 검색결과 리스트 | 인프런
파이썬에 관심있다면 지금 당장 시작하세요! 인프런은 언제나 당신의 성장을 응원합니다.
www.inflearn.com
5. 모두의 파이썬 (길벗 출판사): https://wikidocs.net/book/2
왕초보를 위한 Python: 쉽게 풀어 쓴 기초 문법과 실습
프로그래밍을 한 번도 해본 적이 없는 분들을 위해, 파이썬을 통해 처음으로 프로그래밍을 시작하도록 도와드립니다. ### 목차 0 [머리말](/145) 1 [파이썬…
wikidocs.net
6. 파이썬 코딩 도장: https://dojang.io/course/view.php?id=7
강좌: 파이썬 코딩 도장
모두 펼치기모두 접기
dojang.io
7: 점프 투 파이썬: https://wikidocs.net/book/1
점프 투 파이썬
이 책은 파이썬이란 언어를 처음 접해보는 독자들과 프로그래밍을 한 번도 해 본적이 없는 사람들을 대상으로 한다. 프로그래밍을 할 때 사용되는 전문적인 용어들을 알기 쉽게 풀어서 …
wikidocs.net
8. 점프 투 파이썬 - 라이브러리 예제 편: https://wikidocs.net/book/5445
점프 투 파이썬 - 라이브러리 예제 편
** 점프 투 파이썬 라이브러리 예제 편 종이 책 출간 !! (2022.05) ** * [책 구입 안내](https://wikidocs.net/166499) > 문…
wikidocs.net
'프로그래밍 언어 > Python' 카테고리의 다른 글
Python - 4. 리스트와 문자열 심화 (0) | 2025.01.19 |
---|---|
Python - 3. 제어문 (0) | 2025.01.19 |
Python - 2. 연산과 연산자 (0) | 2025.01.19 |
Python - 1. 자료형과 변수 (0) | 2025.01.19 |
Tkinter 기본 기능 (0) | 2024.07.30 |