1/16 exercise of python

Create a new variable brian and assign it the string “Hello life!”.
1/16 exercise of python

I am struck here
I have tried
name = “brain”

I still keep on getting error message as did you create variable called brain
Please help me try make combinations does not work.

Thanks for your response.

I tried
brain = “Hello life!”

But still I receive the same error - Did you create variable called brain

Yes I created the variable brian
Heres my program

variable = brian
brian = “Hello life!”

still same error

I found the answer…

var = “brian”
brian = “Hello life!”

What is the purpose of the first line of your code?

You are setting your first variable to “brian” like it asked in the directions.
“Create a new variable brian”

Instruction says:

Create a new variable brian and assign it the string "Hello life!".

All you need is:

brian = "Hello life!"

Nothing more :smile:

Your first line creates variable var, not variable brian and you have set its value to "brian", but this line is completely redundant.

But my answer still works too sooooo.

Sure, kudos.

But don’t you think that we all should try to give the best possible answers? That is the reason why I have written my comment.

You have created two variables because you forgotten the correct syntax. I understand this, but I didn’t write my comment to offend you in any way. I just think that it might be kind of dangerous to share badly written code as a correct answer :slight_smile:

Along with that factoradic said, if you want to create multiple variable you cant do
var = “name”
name = “thing”
var = “another_name”
another_name = “another thing”

since that will just change the first ‘var’ to the second one.

also all it does it create a useless variable

brian = “Hello life”

All I keep getting is

Oops, try again. It seems that Brian has value “Hello life.” instead of “Hello life.”

I can’t move on even though I have tried refreshing, rewording, capitals, lower case, commas, full stops, exclamation marks etc.

Well, it should be “Hello life!”, post your code.

hi man am also stack here exercise 16 of python.help me please.
arcpro38645 arcpro38645
February 5
print len(“My_String”)
print my_string.upper()
in the console i get PARROT
none. why cant i continue please help ,me

I think that you should print out length of string stored inside variable my_string.

So it should be:

print len(my_string)

my_string is a variable, "my_string" is string (a plain value).

i kept having trouble with this too. What worked for me was:
brian=“Hello life!”

^brian’s name needs to be all lowercase.

Hey guys. i had this same problem and i fixed it. On line 1 it says #Set the variable brian on line 3!
Make sure there is nothing else written before or after that comment of instructions. Otherwise you will get an error message. I think it’s a typo error by code academy. Because it was like that when the lesson started even after refreshing it!

This is exactly how everything should look:
1 #Set the variable brian on line 3!
3 brian = “Hello life!”

-# Set the variable brian on line 3!

brian = “Hello life!”

Above is my code, exactly how you and the instructions explained. Why is it still returning an error?