python
Float to int Python
float_val = 12.98;
print( int(float_val) );
# 12
Output
12
To convert float value to int in python you can use python inbuilt function int() and pass float value to it as a parameter.
Was this helpful?
Similar Posts
- String to Float conversion in python
- Python Measure the execution time of small bits of Python code with the timeit module
- [Python] Use json.dumps() to pretty-print Python dicts
- [Python] The get() method on Python dicts and its "default" arg
- [Python] Different ways to test multiple flags at once in Python
- Python collection - List in python
- Python collection - Tuples in python