Not seeing your question? It may still have been asked before – try searching for it by clicking the spyglass icon () in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post ().
Hi, in lesson one, part 14 (review), I was asked to enter a comment: The amount of points for each exercise may change, because points don’t exist yet.
I did it like that: I put # and after it a space and then teh comment.
and the program said there was a mistake, I don’t know why. After that, I entered the comment without a space after #: #The amount of points for each exercise may change, because points don’t exist yet
and then it was correct. Could someone explain it to me why? Why was the comment with space after # considered wrong? I thought it didn’t matter whether we use a space or not. I checked it in other Python 2 and Python 3 online compilers and it didn’t matter if I used a space after # or not so was was this an issue in the review section?
Update point_total to be what it was before plus the result of multiplying exercises_completed and points_per_exercise .
This makes no sense to me. The previous request was to create the variable ‘point_total’ and set it equal to 100 so I don’t what understand what they mean by “Update ‘point_total’ to be what it was before”. I also don’t know what they mean by “plus the result of multiplying ‘exercises_completed’ and ‘points_per_exercise’.” Normally when I can’t understand a question I look at the solution and try to figure out what the question meant but there is no option for that in the review. The fourth request is either extremely poorly written or I’m missing something here.
they both come out as
I got 165.0 points!
But the Learn Python 2 program only accepts the second line of code. Could anybody be telling me something I might be missing?
This one was very tricky to resolved! The part i believe we all got confused --> Update point_total to be what it was before plus the result of multiplying exercises_completed and points_per_exercise<- this right here! In others words they are asking to go beyond your learnings which is good! just create another variable and store the multiplying and then use + to add to the point_total. thats the key to solve the problem,
"I got " and " points!" are strings, whereas the value assigned to the point_total variable is a number.
We can’t concatenate (join) a string and a number.
str(point_total) converts the value to a string. This allows us to concatenate the three strings.
A bit later in the course, a lesson titled Explicit String Conversion (in the Strings and Console Output module) briefly goes over this concept.