I write a code but when run it show another output | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I write a code but when run it show another output

13th May 2021, 3:42 PM
Devender Singh Rajpurohit
9 Answers
+ 1
Hi! And what output you want?
13th May 2021, 3:51 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
print (r"C:\\dev")
13th May 2021, 7:12 PM
Oma Falk
Oma Falk - avatar
+ 1
dir = 'C:\\dev' print (dir[dir.index('\\')+1:])
13th May 2021, 8:17 PM
Rohit
+ 1
in sololearn context there's a kind of security transform of path output : they are replaced with the string "..\playground\" ^^ you could achieve quite the right output by adding a space after the colon: print("C: \\dev")
16th May 2021, 1:36 PM
visph
visph - avatar
13th May 2021, 3:42 PM
Devender Singh Rajpurohit
0
dev
13th May 2021, 3:52 PM
Devender Singh Rajpurohit
0
print("dev")
13th May 2021, 3:53 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
i want it from that print("C:\dev") To clear doubt
13th May 2021, 3:55 PM
Devender Singh Rajpurohit
0
print ("C:\\ dev")
13th May 2021, 4:04 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar