본문 바로가기

Python24

3. Python String & why 0.1+ 1.1 ≠ 1.2 1. What are Strings? In Python, strings are a crucial data type used to handle text data. They are represented by sequences of characters enclosed in single (') or double quotes ("), or triple quotes (''' or """) for multi-line strings. 2. String Reassignment Since strings in Python are immutable, reassigning a string to the same variable creates a new string object, and the variable references .. 2024. 3. 13.
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.
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.