Create a string called product


Hey guys, so in one of the lessons it says “Create a string called product that contains the result of multiplying the float value of float_1 and float_2.”, and then I found out the correct answer is product = float_1 * float_2. I thought that strings relied on having quotes, is that not true?

FAQ: Learn Python - Python Syntax - ValueError

I was okay with the first instruction, I can’t figure out the second one. The language is not great, but I still feel like I should be able to get it.

Create a string called big_string that says:

The product was X
with the value of product where the X is.

Please help!
I’m also done here!

I tried a few things, including creating another variable for product, just don’t have enough information.

big_string = x
print "The product was " + str(product)

Tell me tell me tell me


Try defining big_string in its entirety then print it.

big_string = ...

print big_string


yeah, i don’t know man …

need more information
and the more syntax i/we can learn the more we can figure out ways to do things.
this is the first interactive lesson …


There is the complete string. Just assign it to the variable (without the print keyword.


I understand the exercises in these interactive lessons are cumulative in that the early instructions tell you exactly what to do (or close to it) and gradually you have to follow the pattern and figure things out.
I’ve had a lot of trouble with 13/14. Can anyone provide more information and shed some light on the objective and what the code is meant to do?
Or, can you suggest where to look for such information in addition to this forum?

I was able to proceed with the code:

big_string = "The product was " + str(product) + “x”
print "The product was " + str(product)

… which doesn’t even seem like it should be right to me.
Sometimes in coding – and I am a total beginner – you don’t really have to know “why” if you are reasonably certain it will work. Here I would really like to know why.

Perhaps that’s vague, but I’m just looking for more information to understand these operations.


There is an error in this problem

The instructions say that we should create a string called product, which contains the float value of the product of float_1 and float_2

The correct solution is actually to create a float called product which contains that value.


The instruction is a little convaluted. I interpreted it thus…

float_1 = 40.0
float_2 = 0.25

product = float_1 * float_2
big_number = "The product was " + str(product)

print big_number


This would have been easier to figure out if we knew to 1. “not solve for X” (I wasted time trying to assign a variable of X = product… which was not the intended question.) 2. We were given the clue that we would be reassigning a float, or integer, into a ‘string’ which included the ‘product’ as a number.


#Define the product from the value you got from the first equation.
product = 10
#create the string called big_string. with the value of the product where x is
big_string = "The product was " + str(product)


I’m having the exact same confusion. I thought strings were contained inside of “”. I really wish This website was a bit more intuitive for the uber beginners like me. Some of the word choice is so bad, It really makes the learning tedious.


What you are being asked to do here is create a string that fills in the missing information. Take this as an example:

product = 6

big_string = "The product was " + str(product)

print big_string

It is having you practice concatenation using str() to convert an integer into something that can be printed as a string object.


I felt the instructions for ‘Create a string called product…’ are misleading. When you press the ‘run’ button, Codecademy is looking for a float. So the instructions should say ‘Create a value called product’ or ‘Create a variable called product.’ I had this wrong because I was doing str(float_1*float_2), and after I removed the string conversion my answer was accepted.


I also seem to be lost in 13/14 because I also thought strings are always in quotations.I got stuck and generated the solution and once I did, the solution was exactly the same as what I had typed before which was being rejected quoting that my solution was giving a float value of 10 when it should just be 10!!But whatI wrote and what they gave me was the same thing!
float_1 =0.25
float_2 = 40.0
product = float_1 * float_2

big_string = "The product was " + str(product)
print big_string

I still think that exercise has a problem and should be reviewed


Yes, I had a similar issue , the solution to the code still prints a float when the instructions ask for an int. Additionally I did get it to print an int but every time I try to contain a print statement in a variable “big_string” it returns an error. I am sure this comes down to my lack of knowledge/ability but I think this exercise may require review. Thank you , this is a very helpful tool.

EDIT: the reason I was unable to create the variable is because I was adding print to the statement which created a syntax error rather

string = “this is a string” + str(variable) would work. The solution code would return a float though


Here is the correct code but I am sure there are multiple ways of getting this one correct:


product = float_1*float_2

One thing they failed to say in the instructions is that they want the product to be equal to 10 so pick any 2 floats (decimals) that will equal 10.


First step seems to be misleading asking for a string when its looking for an integer. Cant quite work out whats up with this step, feels like an error in the way its written. I initially wrote it like this product = str(float_1 * float_2) which gives the error “You set product to: 10.0 when it should be 10.”

To satisfy the answer it was looking for i ended up changing it to an integer with product = str(int(float_1 * float_2)) which gives 10. But then gives the error “You set product to: 10 when it should be 10.” What the…

Skipping over this one.


Hey, I thought there was an error here too, but it appears that the error is that they are looking for an int, not a string or float.


Came here to say the same thing, though I’d say it’s just incorrect, not misleading.


I don’t understand how this was posted about in april and isn’t corrected as of today. It’s a simple typo in the instructions. I have reported it as a bug as well. Instructions Step 1 says to create a string, when your code is evaluated it does not look for a string hence giving you the amusing error message of “You set product to: 10 when it should be 10.” (At first I got “You set product to: 10.0 when it should be 10”, since i made my string contain result of the multiplied floats… The error message made it seem to look for an int so I then converted it to that before converting it to a string…) Only to find out it was never looking for a string… A fix of the instructions would be nice, trying to learn while instructions are incorrect isn’t pleasant.