Python basic syntax Precautions

1, Python uses the backslash (\) escape special characters if you do not want the backslash escape occurs, you can add a string in front of r

print("fan\ncyop")
fan
cyop

print(r"fan\ncyop")
fan\ncyop

2, except that the C string, Python strings can not be changed. Assigning a value to an index location, such as word [0] = 'm' will cause an error.

Guess you like

Origin www.cnblogs.com/fancyop/p/Python-PointsForAttention.html