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 trialChai Thang
194 Pointshow do you write this code?
favorite_color = input("What is your favorite color? ")
1 Answer
Peter Vann
36,427 PointsHi Chai!
Looks like you have task 1 done OK.
There are two ways to handle task 2, like this:
# Task 1
favorite_color = input("What is your favorite color? ")
# Task 2
print( "The color {} is a great color!".format(favorite_color) )
# Or this (2nd way to handle Task 2):
# print( f"the color {favorite_color} is a great color!" )
More info:
https://realpython.com/python-formatted-output/
I hope that helps.
Stay safe and happy coding!