-1
x=int(raw_input("Enter first number"))
y=int(raw_input("Enter second number"))

I do not understand why I am unable to post this into my Python 3.8.2 shell? Does anyone have any advice on an alternative way?

Thanks.

David
  • 8,113
  • 2
  • 17
  • 36
  • Paste one, then enter the number. Paste the second, then enter that number. Both statements are expecting an input and you aren't giving one between them – Rashid 'Lee' Ibrahim Mar 22 '20 at 20:56
  • To be clear, this is a problem with your terminal/shell, not Python itself. For example IPython doesn't have this problem and I get a totally different error in Gnome Terminal. BTW welcome to Stack Overflow! Check out the [tour] and [ask]. – wjandrea Mar 22 '20 at 21:04

1 Answers1

0

raw_input is python2 syntax and you should use.input.

it was renamed in python 3, refer to the following link: http://docs.python.org/dev/py3k/whatsnew/3.0.html

change to:

x=int(input("Enter first number"))
y=int(input("Enter second number"))

Regarding the issue of pasting both in the terminal, you should read about the input function and you'll see that once it's called it waits for an input and is something was pasted it will take it as an input.

David
  • 8,113
  • 2
  • 17
  • 36