Step-by-Step Guides์ถœ์ฒ˜: DigitalOcean์กฐํšŒ์ˆ˜ 3

How To Use Python Raw String

By Anish Singh Walia
2026๋…„ 3์›” 4์ผ
**How To Use Python Raw String**

Introduction You can create a raw string in Python by prefixing a string literal with r or R. A Python raw string treats the backslash character (\) as a literal character instead of an escape indicator. This makes raw strings useful when a string needs to contain backslashes, such as for regular expression patterns or Windows directory paths, and you donโ€™t want Python to interpret them as escape sequences. When the Python interpreter encounters a normal string like 'Hello\nWorld', it processes \n as a newline character during compilation. With a raw string like r'Hello\nWorld', the interpreter keeps \n as two literal characters: a backslash followed by n...

---

**[devsupporter ํ•ด์„ค]**

์ด ๊ธฐ์‚ฌ๋Š” DigitalOcean์—์„œ ์ œ๊ณตํ•˜๋Š” ์ตœ์‹  ๊ฐœ๋ฐœ ๋™ํ–ฅ์ž…๋‹ˆ๋‹ค. ๊ด€๋ จ ๋„๊ตฌ๋‚˜ ๊ธฐ์ˆ ์— ๋Œ€ํ•ด ๋” ์•Œ์•„๋ณด์‹œ๋ ค๋ฉด ์›๋ณธ ๋งํฌ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.