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 (2015) Python for Beginners Second Quiz

To get look up the documentation about the str class's upper method, I'd use help().

To get look up the documentation about the str class's upper method, I'd use help()

2 Answers

Hi there!

We're talking about this question, right?

To get look up the documentation about the str class's upper method, I'd use help(_________) Be explicit!

Just as a refresher, the help() command returns the information in a class/method/function definition. For example:

>>>def bob():
...       "Function that returns the string 'Bob'"""
...       return "Bob"
>>> help(bob)
Help on function bob in module __main__:

bob()
    Function that returns the string 'Bob'
>>>

So to look up the int class's to_bytes method, we just pass it in to help without calling it:

help(int.to_bytes)

Hope it helps :)

This is the correct answer. (STR.upper) and not (str.upper). The author in the video is referring to the STR and not str in the older version of Python.