Python get float input

Python program to get fractional number from the user.

Sample Input 1:

56.3426

Sample Output 1:

56.3426

Program or Solution

				
			
					
num=float(input("Enter a Number:"))
print(num)

			
				
			

Program Explanation

input() always returns string(), so the function float() converts the input to float.

Comments