H2K Infosys Forum

What is string repe...
 
Notifications
Clear all

What is string repetition using the multiplication operator in Python?

 
Member Moderator

You can repeat a string multiple times by using the * operator in Python. This operator will repeat the string as many times as specified. Python programming online courses often cover this concept to help learners understand string manipulation effectively.

Example:

 
str1 = "Hello "
result = str1 * 3
print(result) # Output: Hello Hello Hello

Here, the string "Hello " is repeated 3 times, resulting in the output.


Quote
Topic starter Posted : 12/12/2025 5:19 am
Share: