Can we call a function at the time of printing. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Can we call a function at the time of printing.

when we write a print statement. can we call a function at that time?

4th Mar 2017, 6:45 AM
KUMAR SHASHWAT
KUMAR SHASHWAT - avatar
5 Answers
+ 13
JavaScript I think. useful question and answer.
4th Mar 2017, 11:11 AM
‎‏‎‏‎Joe
‎‏‎‏‎Joe - avatar
+ 7
yes, you can. but make sure there's no print in that function and the function has to return something. function do_something() { return “hello world“; } print(do_something());
4th Mar 2017, 8:45 AM
Mario L.
Mario L. - avatar
+ 2
for which language?
4th Mar 2017, 8:37 AM
Mohsen Mahdavi
Mohsen Mahdavi - avatar
+ 1
In C++ you can...
7th Mar 2017, 2:58 AM
Shiv Mishra🎸
Shiv Mishra🎸 - avatar
0
Yes, this can be done. In Python as well.
8th Feb 2018, 10:52 AM
Akash Nagarkar