+ 2
I have a doubt..in the previous example..they have said that when a string is used..then double quotes are not displayed in o/p.
6 Antworten
+ 3
but in the next question ..quotes are displayed in the output...if both single and double quotes are used..then what is to be displayed or ignored..this is my doubt..
+ 3
shaistha tabassum when you define string then you need to use " " or ' ' .e.g
print("hi") #output=hi
print('hi') #output=hi
why output is same because you can use " " or ' 'to define a string.
Ok when you use multiple "" or ' '.
Then first " or ' and last one " or ' is ignore by print function because it is use to define string and other " or ' is string.
e.g
print("''hi''") #output=''hi''
Here first " and last one " is ignore by print function because it is use to define a string and othe ' are here string.
+ 3
maninder Singh..I got it .thank you..
+ 2
example of simple output..they have mentioned..if string is used in print function then double quotes are ignored in output
+ 1
Which example.
0
You can try it yourself in Code Playground: Write some print statements, hit RUN and see what happens!