Computer Science

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

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

Python String Manipulation

27 Likes

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.

Answered By

9 Likes


Related Questions