Basically, we cannot add a string and a number, but we can definitely multiply a string and a number. When a string is multiplied with an integer n, the string is repeated n times. The * operator is known as the string repetition operator.
Python String Repetition Examples
We cannot multiply two strings. Also, we cannot multiply a string with a floating-point number.
a="Hello" b="World" c=a*b print(c)
Leave a comment