• Register
100 points
4

Overview 

Today we will see in our website kodlogs how to use * operator in Python is a very easy way.The * operator creates more than one copies of a string. If s is a string and k is an integer, either of the following expressions returns a string consisting of n concatenated copies of t:

K*T

T*K

Operators in python 

What is operator in python. Operators are exceptional symbols in Python that elevate out arithmetic or logical computation. The cost that the operator operates on is known as the operand. 

Arithmetic operators

What is Arithmetic operators in python. Arithmetic operators are used to operate mathematical operations like addition, subtraction, multiplication.Let's see some example. 

x = 12
y = 3

# Output: x + y = 15
print('x + y =',x+y)

# Output: x - y = 9
print('x - y =',x-y)

# Output: x * y = 36
print('x * y =',x*y)

Example 

>>>k='Tania.'
>>>k*3

O/P
'Tania.Tania.Tania'

>>>T='kodlogs.'
>>>T*4

O/P
'Kodlogs.kodlogs.Kodlogs.kodlogs'

 

100 points
4