Help me if me if i am wrong , or tell me if its a bug


Create a string called product that contains the result of multiplying the float value of float_1 and float_2.

float_1 = 0.25
float_2 = 40.0
product = str(int(float_1*float_2))

error : You set product to: 10 when it should be 10.


There is a big difference between '10' and 10. Unlike JavaScript, which is loosely typed and can recognize numbers written as strings, Python cannot.

product = int(float_1 * float_2)

will produce an integer.

Checking the exercise, we do not need to convert to an integer.

product = float_1 * float_2

I think the instruction, create a string called product may be misworded. If I’m reading this lesson correctly the idea is to demonstrate what happens when we try to concatenate a number with a string.

big_string = "The product was " + product

Traceback (most recent call last):
File “”, line 6, in
big_string = "The product was " + product
TypeError: cannot concatenate ‘str’ and ‘float’ objects

which is kind of confusing given that the lesson is called, ValueError.

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

The product was 10.0


but they want me to create a string called produce


See my reply above, “I think the instruction, …”.


yeah , so is it a bug ?


Only if you cannot get my answer to work.


that is exaclty what is happening . I wrote a bug report last week and nothing has changed
what should i do


Show us your code, again, please.


do you get the code when i write the link ?


No. You will need to paste it into a post. We can see the lesson, but it is in our own workspace so we only see our code, not yours.


i already wrote it from the beginning


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.