Computer Science
In Python string, + and * represent which of the following operations?
- Concatenation, Replication
- Addition, Multiplication
- Neither (i) nor (ii)
- Both (i) and (ii)
Python String Manipulation
2 Likes
Answer
Concatenation, Replication
Reason — In Python strings, the + operator is used for concatenation, which means combining two strings into one. The * operator is used for replication, which means repeating the string a specified number of times.
Answered By
3 Likes
Related Questions
A string is a mutable sequence of one or more characters.
Which of the following is not a Python legal string operation?
- 'abc' + 'abc'
- 'abc' *3
- 'abc' + 3
- 'abc'.lower()
Which of following is not a valid string operation?
- Slicing
- Concatenation
- Repetition
- Floor
How many times is the word "Python" printed in the following statement?
s = 'I love Python' for ch in s[3:8]: print('Python')
- 11 times
- 8 times
- 3 times
- 5 times