Python

Python Menu

Python

Python int() Function - Definition, Syntax, Parameters, Examples

Definition

The int() function converts the specified value into an integer number.

Syntax

int(value, base)

Parameters

Parameter Description
value A number or a string that CAN be converted into an integer.
base A number representing the number format. Default value: 10

Examples

myInt = int(8.5) print(myInt) myInt2 = int("34") print(myInt2)

Introduction

Python Basics

Python Advance

Data Science Python Tutorials

Python Functions and Methods