当前位置:网站首页>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 :

边栏推荐
- Soap comparison result file description
- 001 data type [basic]
- The crystal ball "data insight" was officially launched: insight into the change of consumption trend and the details of interactive experience
- 文本匹配——【NAACL 2021】AugSBERT
- 1035 password (20 points)
- Text matching - [naacl 2022] GPL
- [matlab] 2D drawing summary
- L - Jungle roads (minimum spanning tree)
- 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!
- 1031 Hello world for u (20 points)
猜你喜欢

CCF date calculation (Full Score code + skill summary) February 2, 2015

Xiao Sha's pain (thinking problem)

Talk about why I started technical writing
![[matlab] 2D drawing summary](/img/de/6bb5385f440a2997dbf9cbb9a756eb.jpg)
[matlab] 2D drawing summary

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!

Database connection to company database denied

Sum of CCF digits (full mark code + problem solving idea) 201512-1

CCF image rotation (Full Score code + problem solving idea) 201503-01

Determine the number of digits of an integer in MATLAB (one line of code)

What would you choose between architecture optimization and business iteration?
随机推荐
How to get palindrome number in MATLAB (using fliplr function)
G - navigation nightare
Rte2021 review HDR technology product practice and exploration
高精度CNC加工中心为什么会出现误差?这4个原因你要注意!
1031 Hello world for u (20 points)
day02
CCF elimination games (Full Score code + problem solving ideas + skill summary) February 2, 2015
1030 travel plan (30 points)
1133: output family and friends string
1018 public bike Management (30 points)
Npumcm selection question 3 and acmc2020a
Matlab to find prime pairs within 100
左旋梯形螺纹的编程
Summary of C language interview questions
Matlab construction operation example
Jupyter notebook basic knowledge learning
Matlab function for limit, definite integral, first-order derivative, second-order derivative (classic examples)
CCF image rotation (Full Score code + problem solving idea) 201503-01
数控加工中心打刀缸工作原理及故障处理
1149 dangerous goods packaging (25 points)