Exact cin equivalent function in python
Posted
by
gkt.pro
on Stack Overflow
See other posts from Stack Overflow
or by gkt.pro
Published on 2011-01-14T13:44:30Z
Indexed on
2011/01/14
13:54 UTC
Read the original article
Hit count: 202
Suppose user enter this string at terminal
123 456 456 //then hit enter
How do I scan these three (could be more) numbers in different variables in python
Could be something like this:
for i in range(1,n)
m[i]=#WHAT FUNCTION SHOULD I PUT HERE
In c++ we can easily use cin>>m[i]
inside above loop to scan the variables.
If i use input()
or raw_input()
, they would scan whole line in single variable.
© Stack Overflow or respective owner