当前位置:网站首页>4.2 escape characters
4.2 escape characters
2022-06-30 15:15:00 【Andy Python learning notes】
4.2 Escape character
Three quotation marks can realize line breaking function ;\n Line feed function can also be realized .
# No newline
print(' What day is today ? Today is Saturday .')
What day is today ? Today is Saturday .
# Use three quotation marks to wrap
print(''' What day is today ? Today is Saturday . ''')
What day is today ?
Today is Saturday .
# Use escape characters \n Line break
print(' What day is today ?\n Today is Saturday .')
What day is today ?
Today is Saturday .
We need to be in 【 What day ?】 Back to back , It's in 【 What day ?】 Post input 【\n】, Line feed function can be realized .
stay Python in , image \n Such characters are called escape characters ;
The escape character syntax is : The backslash + Escape function initials ;\n Medium n yes 【newline】 The first letter of , It means to move the current position to the beginning of the next line .
newline It means new line . Be careful : Only characters inside double or single quotation marks , Will be recognized as a newline character . If it's not in quotation marks \n, It's not a newline .
The following figure shows the commonly used escape characters :

边栏推荐
- Is Domain Driven Design (DDD) reliable?
- IO interview questions
- 1082 read number in Chinese (25 points)
- Help you accumulate audio and video knowledge, Agora developer's roaming guide officially set sail
- CCF access control system (Full Score code + problem solving idea) 201412-1
- Win10 one click Reset win10 to solve all system bugs without deleting any files and Applications
- Super comprehensive redis distributed high availability solution: sentry mechanism
- day02
- Npumcm selection question 3 and acmc2020a
- Quick sort (C language)
猜你喜欢

CCF window (Full Score code + problem solving idea) March 2, 2014

RTC monthly tabloid programming challenge ended successfully in June; Review of the first anniversary of sound network's listing

CCF command line options (Full Score code + problem solving ideas + skill summary) March 3, 2014

At the beginning of the 2022 new year, I will send you hundreds of dry articles

Experiment of the planning group of the West University of technology -- pipeline CPU and data processing Adventure

Zero basic C language learning notes -- first introduction -- 2 data types & variables and constants

Matlab construction operation example

The sound network has fully opened the real-time transmission network sd-rtn, which has been free of network wide accidents for seven years - this is FPA!

CCF access control system (Full Score code + problem solving idea) 201412-1

Is Domain Driven Design (DDD) reliable?
随机推荐
On which platform is it safer to buy Treasury reverse repo?
Text matching - [naacl 2021] augsbert
Shift operator (detailed)
Solve the problem that codeblocks20.03 on win11 cannot run for the first time
CCF drawing (full mark code + problem solving ideas + skill summary) February 2, 2014
Matlab draws the image of the larger function value of the two functions (super simple)
How to program and process such parts?
Soap comparison result file description
K - rochambau (joint search, enumeration)
One dimensional and two dimensional array addresses
(Niuke) BFS
1082 read number in Chinese (25 points)
Win10 backup backup shows that creating a shared protection point on the shadow failed
Review 2021, embrace change and live up to Shaohua
C. Registration system(map)
Industry analysis | the future of real-time audio and video
1035 password (20 points)
Matlab judge palindrome number (only numbers)
Anyrtc implements application scenarios based on webrtc
文本匹配——【NAACL 2022】GPL