CBSE Class 12 Computer Science Question 35 of 105

Python Revision Tour II — Question 14

Back to all questions
14
Question

Question 14

What is the output of this code ?

 >>> int("3" + "4")
  1. "7"
  2. "34"
  3. 34
  4. 24
Answer
Output
34

Reason — The + operator concatenates two strings and int converts it to integer type.

int("3" + "4")
= int("34")
= 34