Question Detail

COS 102 Python strings Objective Question

Question

To create multiple copies of a string and join them together in Python, which operator is used?
Options
A +
B /
C %
D *
Correct Answer
Correct Answer

Option D is the correct answer.

Detailed Explanation

Page 7, under 'Repetition', states: 'We use the * operator followed by an integer.' This operator is used to repeat a string multiple times.

Hint

Think of the operator that implies 'multiplication' or 'repetition'.

Question Info