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 (Retired) Ins & Outs Ins & Outs

create a variable named "name" with your name in it

dont know how to do this.

name.py
input("what is your name?")

'harsh'
name=input("what is your name?")

name
'harsh'

1 Answer

Just assign your name to a "name" variable

name = "Harsh"

The question is a little bit ambiguous, we can say if they ask to prompt the user his name (with the input() method) or to initialize a variable with your name.

thank you.

also please help me to create variable named treehouse by adding two strings "tree" and "house"

got it.

""" Concat to string """
treehouse = "tree" + "house"