- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python - int() function
Python int() function converts the specified value into an integer number.
The int() function will returns an integer object constructed from a number or string let say x, or return 0 if no argum ents are specified.
Syntax
int(value, base) int(x, base=10)
value = A number or a string that can be converted into an integer number
base = A number representing the number format. Default value − 10
Example
# int() for integers int(10) 10 int(20) 20 # int() for floating point numbers int(11.2) 11 int(9.9e5) 990000
Advertisements