0
How to include \ as part of your string? Example : "martin\" prints martin\\. How do yoo make it print martin\
3 Antworten
+ 3
Only since you have not covered it yet:
' = "
/ = \ = \\
>>>print 'this won't print the whole string'
to include ' in words there are two ways...
either
>>>print "this can't fail"
or
>>>print 'this won\'t fail either' - this is not used often but a backslash serves the same function as \\martin in strings as " \' ".
Dr.
+ 1
did you try to type double backslash?
"martin\\"
since backslash is used in escape-characters, there must be a way to use it as a symbol. and it's easily made by escaping it with another backslash.
+ 1
Martin\\ worked - thank you