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 trialThomas Covington
Courses Plus Student 203 Pointsin 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
27,771 PointsHi,
print() should be the correct for outputting to the screen. input() is used for capturing user input
Nicholas Ah Kun
2,419 PointsNot 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
12,937 Pointsdon't forget to use quotes on a string inside print
print("hello world")