Vidyalelo
Python · Q12

MCQs for Python Data Types and Numeric Types Chapter

Programming · Python · question 12

Q12

How do you convert a string containing an integer to an integer data type?

A.
int("5")
Answer
B.
integer("5")
C.
to_int("5")
D.
convert("5", int)

Answer: Option A

Solution

Answer: Option A
Solution:
The int() function converts a string containing an integer to an integer.