0

where does the print() subroutine, subprogram, or function exist?
sure, you "call" it so it can return a value or result, but from where? from where do you "call" it? where does it exist?

i don't understand!!

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by vegaseat
0

In python 2x, print is a statement, not a subroutine, subprogram, or function.
Hence it exists as part of core language. That is, it is integrated as part of interpreter.

In python 3, print is a function which is found in builtins module (but I am not sure since I don't use python 3)

0

The function print() is part of the core of Python (Python25 and Python30)

It simply prints to the console what you put into its parameter:

print(2 + 3)
pi = 355/113.0
print(pi)
print("pi = %0.4f" % pi)
print('Helen')
print('')
s1 = 'Jim is '
x = 24
s2 = ' years old'
print(s1 + str(x) + s2)
print('-'*20)

"""
my output -->
5
3.14159292035
pi = 3.1416
Helen

Jim is 24 years old
--------------------
"""
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.