CBSE Class 11 Computer Science Question 142 of 173

Data Handling — Question 31

Back to all questions
31
Question

Question 19c

What will be the output produced?

s = 'Sipo'  
s1 = s + '2'
s2 = s * 2  
print(s1) 
print(s2)

Answer

Output
Sipo2
SipoSipo
Explanation
  1. s1 = s + '2' concatenates 'Sipo' and '2' storing 'Sipo2' in s1.
  2. s2 = s * 2 repeats 'Sipo' twice storing 'SipoSipo' in s2.
Answer