1. Home
  2. Data Science
  3. Python
  4. Which of the following methods is used to convert a string…

Added 4 May 2024

Which of the following methods is used to convert a string representation of a number to its corresponding integer value?

  1. to_int()
  2. int() Correct answer
  3. parse_int()
  4. convert_to_int()

Correct answer

B. int()

17 views

MCQSEXAM

Explanation

The int() function in Python is used to convert a string representation of a number to its corresponding integer value.

 

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs