Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Zhanar Khaibullina
4,953 PointsPlease help me with my code!!!
Hello! My problem is that I wrote code in the Work Space and I think my code is correct somehow, but at the same time it's not. Could you tell me what is the mistake in my code
def product(written_name, written_age, written_country):
product = input("Hello, my name is: ")
product = input("My age is: ")
product = input("I came from: ")
print("Hi, my name's {}. I'm {}y.o and I'm from {}.".format(written_name, written_age, written_country))
5 Answers

Chris Freeman
Treehouse Moderator 68,166 PointsIf you want to use the input
function to fill in the fields of the print
statement, make the following changes:
- instead of assigning to
product
, replace "product" with each of the format argument names: written_name, written_age, written_country - since all values will come from
inputs
, no function parameters are needed. Use nothing between the parens
def product():
written_name = input("Hello, my name is: ")
written_age = input("My age is: ")
written_country = input("I came from: ")
print("Hi, my name's {}. I'm {}y.o and I'm from {}.".format(written_name, written_age, written_country))
Post back if you need more help. Good luck!!!

Zhanar Khaibullina
4,953 PointsI want it to be like: so that the thing in a line 5 would output and the those gaps would be filled in by a input function, sorry for my bad English, thank you for your attention!!

Miguel de Luis Espinosa
41,279 PointsOK,
The last line is OK
But
- You have this function "product" that takes 3 attributes: written_name, written_age, written_country
Where do you get the values for these 3 attributes? Nowhere.
- Then you have this variable "product" (same name as the function), that changes its value 3 times, but you never use

Zhanar Khaibullina
4,953 PointsMiguel de Luis Espinosa, thank you ver much!!!

Zhanar Khaibullina
4,953 PointsChris Freeman, thank you very much!

Zhanar Khaibullina
4,953 PointsYeah it works!!!!!!!!!
Zhanar Khaibullina
4,953 PointsZhanar Khaibullina
4,953 PointsOh! And I also have deleted the def function, so now it works!