How can I end input by enter a Blank Character in PYTHON ( raw_input() )? -
such : input 2 integer , b,separated space in middle.
use str.split()
split string @ spaces , can use map
or list comprehension
convert numbers integers:
>>> n1,n2 = map(int,raw_input().split()) 100 20 >>> n1 100 >>> n2 20 >>> n1,n2 = [int(x) x in raw_input().split()] 123 43 >>> n1 123 >>> n2 43
Comments
Post a Comment