What is the output of print('ab' * 2) in Python?
print('ab' * 2)
Correct answer
D. abab
5 views
D. abab
5 views
The * operator repeats a string.
Asked in: Python Interview Strings
https://docs.python.org/3/library/stdtypes.html#string-methodsNot sure why the answer is D? Ask here and get an explanation.