-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.

2
  • 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 Commented Mar 22, 2020 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 How to Ask. Commented Mar 22, 2020 at 21:04

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.