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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![yahyaalshwaily2](https://secure.gravatar.com/avatar/dbda57dd4a9d0134c017c1a09f33ebdc?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
yahyaalshwaily2
Python Development Techdegree Graduate 20,049 PointsWhat does .title() do in category.title() ?
Hi,
What does .title() do in category.title() exactly? I removed it and it did not affect the output at all.
<div class="items">
{% for category, choices in options.items() %}
{% if category != 'colors' %}
<div class="grid-100 row">
<div class="grid-20">
<p class='category-title'>{{ category }}</p>
</div>
Thanks in advance!
1 Answer
![Chris Freeman](https://uploads.teamtreehouse.com/production/profile-photos/1153532/micro_image.jpg)
Chris Freeman
Treehouse Moderator 68,425 PointsThe title()
method is part of the str
object:
>>> "this is a string".title()
‘This Is A String’
You might get similar results using
{{ category|title }}
Post back if you need more help. Good luck!!!
yahyaalshwaily2
Python Development Techdegree Graduate 20,049 Pointsyahyaalshwaily2
Python Development Techdegree Graduate 20,049 PointsHi Chris, I forgot what the .title() method does from "Python Basics" course. Thanks for the reminder. Also thank you for this tip {{category|title}}