When i apply forward slash (/) then why (../playground/) is comes in output? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

When i apply forward slash (/) then why (../playground/) is comes in output?

print('pythonisfun/n'* 7) Then the output is pythonisfun../playground/ And If print('pythonisfun\n'* 7) Then the output will be pythonisfun pythonisfun pythonisfun pythonisfun pythonisfun pythonisfun pythonisfun

23rd Apr 2020, 6:08 AM
Devegna Kanzariya
Devegna Kanzariya - avatar
3 Answers
+ 2
Because "\" is a escaping character in most programming languages if not all. "\n" means break line. Many things you can do with "\". Like in python -> print("hello\tworld") will give you hello world. Because "\t" means "tab". Just learn about escaping characters.
23rd Apr 2020, 6:20 AM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar
+ 1
Devegna Kanzariya (-:Dev;-) "/" is considered as regular string character
23rd Apr 2020, 8:21 AM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar
0
But what happen in "/''
23rd Apr 2020, 7:46 AM
Devegna Kanzariya
Devegna Kanzariya - avatar