Python: Parse a string to Float or Integer
Python Basic: Exercise-48 with Solution
Write a Python program to parse a string to Float or Integer.
Sample Solution:-
n = "246.2458"
print(float(n))
print(int(float(n)))
======== RESTART: F:/Python_APSC/py-ex-basic-48.py ==========
246.2458
246
>>>
沒有留言:
張貼留言