1

it's supposed to add a and b after you type them , example is 2 ,5 ,it should return 7.

import sys
input = sys.stdin.read()
tokens = input.split()
a = int(tokens[0])
b = int(tokens[1])
print(a + b)

But, when i run it, it's just stuck and it doesn't do anything , i type the numbers and it doesn't do anything.

Is it because i'm using the 3.5 version?

Rahul K P
  • 15,740
  • 4
  • 35
  • 52
user31731
  • 25
  • 1
  • 1
  • 7

1 Answers1

3

No, sys.stdin.read() will read until the stream ends (you can press Ctrl-D to send the Signal) use input(). (Also, don't use input, or any other keywords or standard methods as a variable name.)

phogl
  • 494
  • 1
  • 8
  • 16