Coding Fundamentals "Fill in the blanks" problem

4-1
module-4

#1

Hi,

I am stuck on section 4.1 Coding fundamentals, the last fill in question. I have gotten it wrong several times but am not sure what I am doing wrong. I would love to see where my mistake is and how to fix it.

Thanks,
Denise


#2

Hi Denise,

There’s two main places I usually see people get stuck on this problem.

The first is changing variable names, even a little bit. If you store a value in a variable called optionA, then later try to use that value by calling it A or option_A, the computer won’t know what you’re talking about. Make sure you pay attention to the given variable names.

The other issue that sometimes arises is when you try to skip a step. This code could be perfectly functional in only three lines, but we’ve split it up to four lines for clarity’s sake. Although combining the third and fourth steps into the fourth blank would satisfy a computer, the course site only allows us to set one answer as correct.

If you’re still having issues after making sure you’ve fixed either of the mistakes listed above, take your code from step 16 and paste it in the editor in step 15 and run it. The resulting message in the shell below the editor should help you in the right direction.


#3

my issue was with the last line. Had to be the_sum, not just sum.
Thanks your your help!


#4

I’ve entered as follows and still getting it wrong. Can someone help?
EDIT: Instructor removed code very close to the solution.


#5

To consider-- if number1 and number 2 are already defined as integers, do you need to define the sum as an integer, as well?


#6

im getting the same issue.
ive put in the answers in every conceivable way i can think of but i cant get past it.

EDIT: Instructor removed code very close to the solution

and im still not getting it.


#8

Thank you!! Looks like it does not need the parenthesis around number1+number2 and do not need “int” either. Mine finally worked!


#9

Hey all, I think I’ve managed to set this problem up so that it will now accept your answer if you’ve placed parentheses around number1+number2. Hopefully that will clear up some future issues.

In the future, please try to avoid posting specific answers to problems - I’d rather you guide students to find the answers themselves instead of just providing a solution. Take a look at how @Mystified13 responded for an example.


#10

Sorry about that. Just wanted to help and wasn’t thinking of the proper way to help. I removed my post so no one else can see the whole answer.


#11

I’ve read through the string of responses here and tried several combinations. I’m still not finding the proper string.

When I did step 15 before reading the question on step 16, I was able to complete it with no problem. when I tried the different ways on step 16, every time I get stuck.

In the blanks, does a specific integer need to be entered?


#12

None of the blanks need to be filled by integers, you’re working to build a few lines of code that can be run for any two integers the user enters.


#13

That helped! And on step 15 I was using specific numbers so it makes sense why then I was struggling for 16. Thank you!


#14

Help!!! I am at a complete lost. I was able to successfully complete step 15 (using the form given in 16) but when I try to plug in my answers to 16 it keeps telling me I’m wrong. But my code works! Help!


#15

I’ve read the thread and tried all of the recommendations already


#16

Never mind. I figured it out already


#17

I’m having a issue that my code works in 4.1 15 step , but when i type same thing into step 16 it says it is not right. I don’t get it


#18

I’ve been working on this problem for three days, have entered the answer in every conceivable way, and I can’t get past it. Like someone else mentioned, I enter the exact same code into the practice step right before it and it works fine. I understand that you want us to “be persistent” but I don’t know how many more hours I can spend on this question before it’s considered a form of madness.


#19

Same issue. Were you able to find a solution?


#20

Here’s the code I enter into the practice terminal:

Edit: Per our posting guidelines, please do not post significant amounts of code outside of private messages. Thanks!


#21

A few thoughts. One is, I think the course only needs you to print the sum itself, not a line of text that includes the sum (though that might make for user-friendly programming). Also-- I am curious about the use of the “float” designation? If both inputs are integers, then is it necessary to designate them as floats when creating a sum?