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

How do I create a variable with my name in it.

I worked it out as name=(what is your name?') and also worked it out as if name=="sibusisiwe", then i worked print( sibusisiwe +" is a lady and she fine.") and also print(sibusisiwe+"is a lady and "(sibusisiwe+" she is fine.") and pressed return but still its bummer what should i do.

name.py
NAME=INPUT("WHAT IS YOUR NAME?")
IF NAME=="SIBUSISIWE":
  PRINT(SIBUSISIWE+"IS A LADY AND SHE IS FINE.")
  ELSE:
    PRINT(SIBUSISIWE+"IS AN ATHLET AND"SIBUSISIWE+"ALSO LOVES FOOTBALL!")

1 Answer

First of all remove the caps lock as that is one of the reason you have this struggle. The challenge asks you to use the variable "name" not "NAME" and when you write everything in uppercase while coding it looks troubling. So the caps lock has to go. Secondly it says create a variable name with your name in it, i'll paraphrase it to create a variable name and assign your name to it.

Your name is Sibusisiwe Dube. That's a string so you need to enclose it in quotes, which gives me "Sibusisiwe Dube" now you have to assign that, (which means use the simple assignment operator =) to your name. Once you do all that you have

name = "Sibusisiwe Dube" 

By the way, welcome to Treehouse ! :)

thank you Gloria that worked

You are welcome