마인드 맵 갤러리 Python 기본(2)
기본 구문, 기본 데이터 유형, 유형 변환, 공통 연산자, 구조화된 프로그래밍 설계 등 Python(2)의 기본 지식에 대한 마인드맵입니다.
2024-11-25 15:57:05에 편집됨Dive into the world of the Chinese animated film Nezha 2: The Devil's Birth! This knowledge map, created with EdrawMind, provides a detailed analysis of main characters, symbolic elements, and their cultural significance, offering deep insights into the film's storytelling and design.
This is a mindmap about Nezha 2, exploring its political metaphors and cultural references. The diagram highlights the symbolism behind the Dragon Clan’s suppression, drawing parallels to modern geopolitical conflicts and propaganda manipulation. It also details Chinese historical and cultural elements embedded in the film, such as the Jade Void Palace, Ao Bing’s armor, Taiyi Zhenren’s magic weapon, and Nezha’s hairstyle.
This is a mindmap about the main characters of Nezha 2, detailing their backgrounds, conflicts, and symbolic meanings. It explores the personal struggles and transformations of Nezha, Ao Bing, Shen Gongbao, and Li Jing as they navigate themes of rebellion, duty, ambition, and sacrifice.
Dive into the world of the Chinese animated film Nezha 2: The Devil's Birth! This knowledge map, created with EdrawMind, provides a detailed analysis of main characters, symbolic elements, and their cultural significance, offering deep insights into the film's storytelling and design.
This is a mindmap about Nezha 2, exploring its political metaphors and cultural references. The diagram highlights the symbolism behind the Dragon Clan’s suppression, drawing parallels to modern geopolitical conflicts and propaganda manipulation. It also details Chinese historical and cultural elements embedded in the film, such as the Jade Void Palace, Ao Bing’s armor, Taiyi Zhenren’s magic weapon, and Nezha’s hairstyle.
This is a mindmap about the main characters of Nezha 2, detailing their backgrounds, conflicts, and symbolic meanings. It explores the personal struggles and transformations of Nezha, Ao Bing, Shen Gongbao, and Li Jing as they navigate themes of rebellion, duty, ambition, and sacrifice.
파이썬 기초
기본 문법
들여쓰기: Python은 들여쓰기를 사용하여 다른 언어와 같은 중괄호 대신 코드 블록을 나타냅니다. 예를 들어, 함수, 조건문, 루프문을 정의할 때 들여쓰기된 내용은 동일한 코드 블록에 속합니다. 주석: 주석을 추가하는 방법에는 두 가지가 있습니다. 한 줄 주석은 "#"을 사용하고, "#"부터 줄 끝까지의 내용은 주석입니다. 여러 줄 주석은 삼중따옴표(''' 또는 """)를 사용하여 필요한 내용을 감싸줍니다. 댓글을 달다. 명령문 끝: 일반적인 상황에서는 한 줄에 하나의 명령문이 있으며 명령문 끝에 세미콜론은 필요하지 않습니다. 그러나 한 줄에 여러 명령문을 작성하려면 세미콜론으로 구분하면 됩니다.
기본 데이터 유형
숫자 유형 정수형(int) : 1, -5, 100 등의 정수를 나타냅니다. Python 3에서는 메모리가 허용하는 한 정수에 크기 제한이 없습니다. Float 유형(float): 3.14, -2.5 등과 같은 소수를 나타냅니다. 0.000123의 경우 1.23e-4와 같이 과학적 표기법을 사용할 수 있습니다. 문자열(str): 작은따옴표('), 큰따옴표(") 또는 삼중따옴표(''' 또는 """)로 묶인 문자 시퀀스입니다. 예를 들어 'hello', "world", '''여러 줄 문자열입니다. 여러 줄 '''에 걸쳐 있을 수 있습니다. 부울형(bool) : 논리적 판단에 사용되는 값은 True(true), False(false) 두 가지뿐입니다.
유형 변환
암시적 변환: 특정 작업에서 Python은 자동으로 유형 변환을 수행합니다. 예를 들어 정수와 부동소수점 숫자를 더하면 자동으로 정수가 부동소수점 숫자로 변환된 후 연산이 수행됩니다. 명시적 변환: int()와 같은 함수를 통해 수행되며 정수 형식을 따르는 문자열 또는 부동 소수점 숫자를 정수로 변환할 수 있습니다(부동 소수점 변환은 소수 부분을 자릅니다). float()는 다른 유형을 부동 소수점으로 변환합니다 숫자, 다른 유형을 문자열로 변환하는 str( ).
일반 연산자
산술 연산자: 더하기( ), 빼기(-), 곱하기(*), 나누기(/), 정수 나누기(//, 몫의 정수 부분을 반환), 나머지(%), 지수(**). 관계 연산자: 보다 큼(>), 보다 작음(<), 같음(==), 크거나 같음(>=), 작거나 같음(<=), 같지 않음(!=), 연산 결과는 부울 값입니다. 논리 연산자: and(and), or(or), not(not), 논리 조건 판단을 결합하는 데 사용됩니다. 할당 연산자: 기본 할당은 "="이며, =(a = 1은 a = a 1과 동일함), -=, *= 등과 같은 복합 할당 연산자도 있습니다.
구조화된 프로그래밍
- 순차적 구조: 위에서 아래로 순서대로 코드가 실행됩니다. 이는 가장 기본적인 프로그램 실행 흐름입니다. - 구조 선택 - if 문: 형식은 if 조건: 문 블록입니다. 조건이 true인 경우 문 블록이 실행됩니다. 더 많은 분기 판단을 달성하기 위해 Else 및 elif를 추가할 수 있습니다. 예를 들어: 파이썬 점수 >= 90인 경우: print("훌륭해요") elif 점수 >= 60: print("통과했습니다") 또 다른: print("실패했습니다") - 삼항 표현식: result = "Yes" if a > 10 else "No"와 같은 간단한 if-else 문의 단축 형식입니다. - 루프 구조 - for 루프: 일반적으로 반복 가능한 객체(예: 목록, 문자열 등)를 순회하는 데 사용됩니다. 예를 들어: 파이썬 과일 = ["사과", "바나나", "체리"] 과일 속의 과일: 인쇄물(과일) - while 루프: 조건이 true일 경우 해당 명령문 블록이 루프에서 실행됩니다. 예를 들어: 파이썬 개수 = 0 개수 < 5인 동안: 인쇄(카운트) 개수 = 1