Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to print without using the print function in Python?

I wondered whether it is possible to print (for example a string) in Python without the print function. This can be done by a command or by some trick.

For example, in C there are printf and puts.

Can someone show me a way to print or to deny this possibility?

like image 453
Gari BN Avatar asked Jun 25 '26 20:06

Gari BN


2 Answers

sys.stdout.write("hello world\n")
like image 184
GreenAsJade Avatar answered Jun 27 '26 08:06

GreenAsJade


import sys
sys.stdout.write("hello")
like image 25
Rahul Mahadev Avatar answered Jun 27 '26 09:06

Rahul Mahadev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!