0
Can anyone tell the logic behind this print('print("print") ')
7 Respostas
+ 5
Python only recognize the first print('
everything after the first bracket will display like a string
+ 2
That statement prints the statement inside the quotes, just like a normal print statement. It will result in print("print") output to the screen.
+ 2
print ('print ("print ")')
print (print (print(Z)))
Hello Vipul, try running the above code and you will notice that any thing enclosed in quotes is treated as output, whereas if you run the same without quotes and enter a variable with some value, it will give you the value of Z. Hope that helps
0
print('[any symbols, this is string]') - in this sample [any symbols, this is string] = print("print")
0
() is important that excute whole (). then ' ' mean string. so it is like that
0
Good stuff
- 1
but isn't there supposed to be a backsplash before a single/double quote inside the print function?