I want to read two input values. First value should be an integer and the second value should be a float.
I saw Read two variables in a single line with Python, but
This is good solution imho a, b = input().split()
.
If you want to separate input with custom character you can put it in parenthesis e.g. a, b = input().split(",")
If the input is separated by spaces " "
a,b,c = raw_input().split(" ")
If the input is separated by comma ','
a,b,c = raw_input().split(",")
Below snippet works for me.
a, b = input().split(" ")
a_value = int(a)
b_value = int(b)
Below snippet works for me.
>>> a,b=list(map(int,input().split()))
1 2
>>> print(a)
1
>>> print(b)
2
One liner :)
>>> [f(i) for f,i in zip((int, float), raw_input().split())]
1 1.2
[1, 1.2]