Sum and input/output

homework
python

#1

I’m having a little trouble with this:

In the last problem I wrote a shell script that looked like this:

x= int(input(“Enter first number:”))
y= int(input(“Enter second number:”))
sum=x+y
print(“Sum of the given two numbers is:”, sum)

In their form I tried this:

The last line reads:

print(“Sum of the first number and the second number is:”, sum)

Any thoughts would be appreciated. Thanks

–Will.


#2

Is number2 supposed to also be an int?


#3

Yes, and I was not trying that before. I will include that in my future answers. I still haven’t found the exact way they like it, but you thought of something I was not considering. Thanks!


#4

I’m not sure we can access that particular part of your CS course. Can you go back to the beginning of the course and post a link? If we can access it, we’ll try it out. Otherwise you’ll have to keep trying.

Aside

Are you enrolled in a college or university program that uses this service to present some of the learning material? Don’t give private information, just a yes or no.


#5

It is on Stepik

but you don’t have to go through the whole module to get to this question.


#6

You need to keep it simple, and as literal as possible…

coding_fundamentals

If your have more problems like this, give a link with your question. The course is locked (as expected) but it still let me compete the problem.


#7

Thanks!I knew it had to be something simple like that because my code was working in their Linux emulator.


#8

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