+ 7
Where to write a \ into a string to separate double quotes enclosed number from string (“”) ???
I need to output by using \ print(“A number enclosed in double quotes: 42”) After having tried a whole hour I wrote my own code with same output ... but it’s not accepted .... Can somebody help me please
5 Respuestas
+ 8
Thx very much but I found it from myself...!!
print(‘A number enclosed in a double string: “42”’)
Just needed to change strings double quotes in single quotes 😆
+ 3
lol I forgot that ;)
+ 2
Try this:
print(' A number enclosed in double quotes : \"42\" ')
+ 2
Keeping some knowledge about escape sequences is handy btw, for example you would be able to handle situations where you might need both " and ' quotes in one string and it is applicable throughout most languages
+ 1
"Here a enclosed thing : \"42\""