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 Calling the API

Gloria Avalos
Gloria Avalos
44 Points

why did she put an f before https://?

res = requests.get(f"http://

1 Answer

Steven Parker
Steven Parker
243,318 Points

The "f" makes it an "f-string" (formatted string). This causes the tokens in the string made up of variable names surrounded by braces to get replaced by the contents of those variables.

F-strings are introduced in the other Python courses.