0
What is the difference between using print and solely inputting in string?
the difference between using 'print' and string
5 Réponses
+ 1
Ok, so I assume Python.
In shell this might work.
But if you type the string in playground or any .py file and compile it, you won't get any output for just using a string.
There you definitely need print() to get output into the console.
+ 4
Print is a method used to output content to the console/user interface.
Strings are variables used to store a series of characters, which can later be manipulated using text/string processing algorithms.
+ 1
thank you, Matthias, I am sorry for not putting the context before. It is python.
Right, i was confused because the question in the string module put the triple quotes right away and there was an output. So i thought displaying any text in python could be done just by using the quotes mark.
Also, i don't quite understand what the "newline" module is trying to told me about..
edit: now i understand the purpose of the triple quote: it helps you not to bother yourself typing backslash n to make a new line. but, it only works by using "print" stuff.
Thank you everybody.
0
Which language?
Could you give an example?
0
>>>"Hello World"
>>>print('Hello World')