Q. Which Python function converts a string to an integer?

A
str()
B
int()
C
float()
D
len()
Solution:

The int() function converts a string or float to an integer, provided the string represents a valid number.

Entri PDF Icon

Get Question Bank

Strengthen Your Practice with our comprehensive question bank.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!