Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics (Retired) Ins & Outs I/O

in python to output something to the screen use what .......function. Print() and input() are wrong answers.

in begging python what function do I use to have output to the screen in the print() function is not used?

3 Answers

Hanley Chan
Hanley Chan
27,771 Points

Hi,

print() should be the correct for outputting to the screen. input() is used for capturing user input

Not sure I exactly understand your question but am assuming you are asking: "in beginning python what function do I use to have output to the screen, if the print() function is not used"

print() should work for any object that has a str method.

Assuming you do not wish to use the print() function, in the interpreter itself, it will return values once you enter a valid statement (e.g. a = 1+2 Enter. a Enter will print 3 to the screen without using the print() function)

The other thing you might be looking at that 'prints' to the screen without using print() is dir(object) or type(object), these will print to the screen, the methods in the object, however it won't print the VALUE of any specific attribute.

hector villasano
hector villasano
12,937 Points

don't forget to use quotes on a string inside print

print("hello world")