Answers for "python print raw string"

7

python raw string

#A raw string considers backslash as literal instead of an escape character
print(r"C\Users\MyName\Desktop")
#Without the r in front you will have to escape the \ with another \
print("C\\Users\\MyName\\Desktop")
#Both will print the same thing "C\Users\MyName\Desktop"
Posted by: Guest on May-27-2020
2

raw string python

>>> s = r'Hi\xHello'
>>> print(s)
Hi\xHello
Posted by: Guest on July-07-2020
0

python print raw string

>>> print(repr('abc 123 \n'))
'abc 123 \n'
Posted by: Guest on June-02-2021

Python Answers by Framework

Browse Popular Code Answers by Language