4.1, the very last fill in the blank

4-1
module-4

#1

I am having a really hard time getting this answer to be correct.

Fill in the missing information from the statements below so that the entire code block fulfills the program requirements from the last step and prints the desired output. You only need to supply the parts of each statement that are not shown below.

Fill in the Blanks — Fill in the blanks
Wrong.
number1 = int(__________ ("Enter the first number: "))
number2 =____________ (input("Enter the second number: "))
the_sum =______________
print( _________)

I have done this over and over and over and still cannot seem to get an answer right. PLEASE HELP!!! BRAND NEW TO THIS!!!


#2

If you’re not sure what these lines are looking for, check out the code in 4.1 steps 11 and 12. Those are the steps that should give you an idea of how to work with user-provided input, as well as repeating the ideas of variable operations and printing.

Make sure you keep in mind that this code needs to work for any integers entered by the user, not simple hard-coded numbers in your code.


#3

I think it helps, and with coding in general, if you draw up an algorithm, or a plan containing what you need to do.

If you know what tasks the code has to accomplish, you can create the code step by step, line by line.


#4

I am really struggling on this problem. I have been working on it for days. Help someone please!!!

admin: edited to remove mostly correct code

print(“The sum of input number is:” , the_sum)


#5

My guess is that they just need the sum itself on the last line, not the rest of the text. Finicky, sure, but that’s typical of fill-in-the-blank stuff.


#6

Thanks so much. I finally got it


#7

If you could provide helpful advice it would be super appreciated.


#8

I feel like I’m just not getting what the final answer should say. I’ve tried it in Repl.it and it works, but I don’t know if the last step wants me to say something like: "Your final integer is: " or what. If I just put print(the_number), then the sum comes out just fine, but that doesn’t seem to be the answer this question is looking for. argh!!!


#9

The last line of the program should only print the value without any additional formatting. So if your sum is 15, your program should print:

15

Another issue with your code specifically, @trinavr, is that you’ve got an extra call to int() in the third box. We don’t need to make the numbers into ints when we add them – we already made them ints when we took the input!

If you fix those issues, you should be good.


#10

Thank you! I was going crazy!


#11

Can someone please tell me where I went wrong? My code is as follows:

number1 = int(input (“5:”))
number2 = int(input (“3:”))
the_sum = (number1 + number2)
print (the_sum)


#12

hmm. . . looking at those inputs, wondering about the colon “:” in them, if that’s causing any issues.