본문 바로가기

분류 전체보기137

2. Variables in Python 1. Variable Variables are an important concept used to store and manage data in programming. A variable is a named memory space that is used to store or reference a value. 2. Data Types of Variables Dynamic typing: Automatically infer the type of a variable when assigning a value without having to declare it. Pros: Reduces the burden on programmers and can make code more concise. Cons: Values of.. 2024. 3. 13.
2. 파이썬의 변수 1. 변수 변수는 프로그래밍에서 데이터를 저장하고 관리하는 데 사용되는 중요한 개념입니다. 변수는 이름이 붙은 메모리 공간으로, 값을 저장하거나 참조할 때 사용됩니다. 2. 변수의 잘료형 동적 타이핑: 변수를 선언하지 않고도 값을 할당할 때 변수 유형을 자동으로 추론합니다. 장점: 프로그래머의 부담을 줄이고 코드를 더욱 간결하게 만들 수 있습니다. 단점: 잘못된 유형의 값이 변수에 할당될 수 있습니다. 기본 데이터 타입: 정수 타입 (int): 정수 값을 나타냅니다 (e.g., 1, 2, 3) 부동소수점 타입 (float): 실수 값을 나타냅니다 (e.g., 3.14, 1.234) 문자열 타입 (str): 문자나 문자열을 나타냅니다 (e.g., "Hello", "Python") 부울 타입 (bool): .. 2024. 3. 12.
1. Python Output 1. Print Function The print() function is the most basic output function in Python. It is used to display text or data on the terminal or console window. sep : Specifies the separator to be inserted between values. The default value is a space (' '). end : Specifies the character to be printed at the end of all values. The default value is a newline ('\n'). 2. Escape Characters in Python Escape .. 2024. 3. 12.
1. 파이썬의 출력 1. print 함수 print() 함수는 파이썬의 기본 출력 함수로, 터미널이나 콘솔 창에 텍스트나 데이터를 출력하기 위해 사용됩니다. sep : 값들 사이에 들어갈 구분자를 지정합니다. 기본값은 공백(' ')입니다. end : 모든 값들이 출력된 후 마지막에 출력될 문자를 지정합니다. 기본값은 줄바꿈('\n')입니다. 2. 파이썬의 escape 문자 파이썬에서 이스케이프 문자는 문자열 안에서 특별한 의미를 가지는 문자들을 나타내기 위해 사용됩니다. 이스케이프 문자는 백슬래시()로 시작하며, 문자열 내에서 특정한 동작이나 특수 문자를 표현하기 위해 사용됩니다. \n: 줄바꿈을 나타냅니다. \t: 탭 문자를 나타냅니다. \\: 백슬래시 자체를 나타냅니다. \" 또는 \': 큰따옴표나 작은따옴표를 나타냅니.. 2024. 3. 12.