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
A,B = raw_input().split(" ")
A = int(A)
B = float(B)
print(A)
print(B)
34 6.9
34
6.9
If you wish to take as many inputs as u want then following:
x=list(map(str,input().split()))
print(x)
If you want two inputs:
x,y=x,y=list(map(str,input().split()))
print(x,y)
Read 3 inputs separated by space...
arr = input().split(" ")
A = float(arr[0])
B = float(arr[1])
C = float(arr[2])
print(A)
print(B)
print(C)
map(str,input().split())
that is how you do it.
Like this:
In [20]: a,b = raw_input().split()
12 12.2
In [21]: a = int(a)
Out[21]: 12
In [22]: b = float(b)
Out[22]: 12.2
You can't do this in a one-liner (or at least not without some super duper extra hackz0r skills -- or semicolons), but python is not made for one-liners.
Simpler one liner(but less secure):
map(eval, raw_input().split())