본문 바로가기
반응형

in5

[Python] Comprehensive Guide to Using "if" Using "if" in Python     Table of Contents * Code is basically composed of format. Basic Form (1): ifif condition: statementIf the condition is True (or 1), the statement is executed.If the condition is False (or 0), the statement is not executed.if True: print('if statement executed')# Output: if statement executedif False: print('if statement executed')# Output: Basic Form (2): if el.. 2024. 7. 24.
[Python] Comprehensive Guide to Using "for" Loops Using "for" Loops in Python     Table of Contents * Code is basically composed of format. Basic Form (1): for infor variable in object: statementHere, the object typically refers to a string, list, tuple, or dictionary.The variable is sequentially assigned values from the first to the last index of the object.for x in 'abc': Here, x starts with 'a' and is subsequently assigned 'b' and 'c'.fo.. 2024. 7. 24.
[파이썬, Python] for문 활용법 총정리 [ 파이썬 for문 활용법 ]  * 코드는 기본적으로  으로 구성되어 있습니다. * 아래 [더보기] 클릭 후 [Ctrl + F] 단축키를 활용하여 찾고 계신 함수 위치로 바로 가실 수 있습니다.더보기기본형(1) : for in 기본형(2) : for in range 기본형(3) : 다중 for문 for 관련 함수 : continue, break for 관련 함수 : else 리스트 내포  기본형(1) : for in for 변수 in 객체:    실행문 여기서 객체는 일반적으로 문자열, 리스트, 튜플, 딕셔너리를 의미함변수는 객체의 첫 인덱스에 해당하는 값부터 마지막 인덱스에 해당하는 값까지 차례대로 정의됨ex) for x in 'abc' 일 경우 x는 'a' 부터 시작하여 'b', 'c' 순으로 정의됨.. 2022. 3. 26.
[파이썬, Python] if문 활용법 총정리 [ 파이썬 if문 활용법 ] * 코드는 기본적으로 으로 구성되어 있습니다. * 아래 [더보기] 클릭 후 [Ctrl + F] 단축키를 활용하여 찾고 계신 함수 위치로 바로 가실 수 있습니다. 더보기 기본형(1) : if 기본형(2) : if else 기본형(3) : if elif else 조건문 유형 : 객체 내 요소의 존재 여부 조건문 유형 : in, not in 조건문 유형 : 비교연산자(==, !=, >, >=, =, = 값2 : 값1이 값2보다 크거나 같으면 True, 작으면 False 값1 2022. 3. 23.
[파이썬, Python] 딕셔너리 관련 함수 총정리 [ 파이썬 딕셔너리 관련 함수 정리 ] * 코드는 기본적으로 으로 구성되어 있습니다. * 아래 [더보기] 클릭 후 [Ctrl + F] 단축키를 활용하여 찾고 계신 함수 위치로 바로 가실 수 있습니다. 더보기 딕셔너리 인덱싱 & 슬라이싱 불가: get 딕셔너리 {Key: Value} 추가 딕셔너리 {Key: Value} 제거 : del, clear 딕셔너리 복사 : =, dict, copy 딕셔너리 내장 함수 : len 딕셔너리 내장 함수 : items, keys, values 딕셔너리 내장 함수 : in 딕셔너리 내장 함수 : max, min, sum type(변수) : 딕셔너리(dictionary) a, b = {}, dict() print(type(a)) # print(type(b)) # c = {'.. 2022. 3. 17.
반응형