+ 1

Can you tell me pls whats this code

Print(r\n"hello")

14th May 2020, 12:43 PM
Metin Keskin
Metin Keskin - avatar
4 Antworten
+ 6
Its attempting to print a "raw string" Thats just any string ('this is a string') with "r" in front. So : rstring = r'this is a raw string' What that does is print exactly whats in the string EVEN if its an escape character (\n, \t, \\, ect) So... a = r'\nThis is a\nraw string' print(a) IT WONT BE: This is a raw string It will be: \nThis is a\nraw string
14th May 2020, 12:52 PM
Slick
Slick - avatar
0
Maybe I thought that this character \ is show orginal for """" quates
17th May 2020, 1:18 PM
Metin Keskin
Metin Keskin - avatar
0
What exactly do you mean by that?
17th May 2020, 1:19 PM
Slick
Slick - avatar
- 1
It prints simple text
14th May 2020, 2:12 PM
CodeFu
CodeFu - avatar