CBSE Class 11 Computer Science Question 44 of 91

String Manipulation — Question 4

Back to all questions
4
Question

Question 4

Which of the following is not a Python legal string operation?

(a) 'abc' + 'abc'
(b) 'abc' * 3
(c) 'abc' + .3
(d) 'abc.lower()

Answer

'abc' + .3 is not a legal string operation in Python. The operands of + operator should be both string or both numeric. Here one operand is string and other is numeric. This is not allowed in Python.

Answer