Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 1
Is print command useless?
It seems using quotation marks without the print keyword gives the same result of printing the text.
4 Respostas
+ 7
It won't. It will just show the same text in the interactive prompt.
https://code.sololearn.com/c2ZJiR2wKDho/?ref=app
+ 3
print() will call the objectās __str__() method. Simply typing a variable in interactive mode will call the objectās __repr__() method. They arenāt always the same. Besides, print() can be used multiple times in script mode, while the other option will (as far as I know) only work for the last variable.
+ 1
Do you have an example to post here? This definitely doesnāt work for me. Print is actually a function so without it, nothing happens.
+ 1
print is probably the most important thing in python because thats how you get an output most of the time
ex.
print(āhello worldā)
output- hello world
x = 5-2
print(x)
output- 3