1
def addNumber(fNum, lNum):
    sumNum = fNum + lNum
    return sumNum

x = int(input('enter first number \n'))
print(x)
y = int(input('enter last number \n'))

print(addNumber(x,y))

output is

enter first number 10
20

no matter what I enter for my output nothing happens doesn't move to the next line of my program

TonyG80
  • 27
  • 6
  • I know this is a basic question but I have looked all over and everything I see says this should be just fine to have the user enter input. But it's not the output just stops and I can't get it to progress through the program. – TonyG80 Mar 05 '18 at 00:19
  • 4
    This works fine for me. Are you seeing any error output? – Patrick Haugh Mar 05 '18 at 00:20
  • 3
    Works fine on my end as well. – Anthony L Mar 05 '18 at 00:22
  • I just don't know why it's not working. I run other code in the same file just fine – TonyG80 Mar 05 '18 at 00:27
  • There are no output errors – TonyG80 Mar 05 '18 at 00:28
  • I'm also new at StackOverFlow so I apologize for the poor formatting – TonyG80 Mar 05 '18 at 00:30
  • Since you mentioned a formatting of your question - check the indentation! The code sample you provided has no indentation, so the addNumber definition is not correct. – dr_agon Mar 05 '18 at 03:13
  • Thanks for that, in my actual code the indenting was correct. I put it in a different file tried it again and it's till not going to the next line of code. This is so simple it's frustrating that I can't get it to work. – TonyG80 Mar 05 '18 at 03:36
  • So I ran this code in Notepad++ and it ran fine. What is strange is I can run other code just fine in Sublime but for some reason when I use this user input command it simple fails. Any ideas on how to fix my sublime IDE or what could be causing this would be appreciated. – TonyG80 Mar 05 '18 at 04:22
  • @OdatNurd thanks for that comment, that was the problem. Instead of fixing Sublime I decided to just use Notepad++ instead. Thanks again for that help. – TonyG80 Mar 07 '18 at 01:01

0 Answers0