Computer Science, asked by arup4216, 2 months ago

Difference between the function of + operator when used with a narrator and string values

Computer science

Answers

Answered by AnushGudimetla
0

Answer:

When + operator is used with integral / float values, it adds the numbers and gives their sum. When + operator is used with string values, it concatenates the strings, meaning it combines them.

Eg-

a = 1 + 1

print(a) # this outputs 2

b = "Hello-"

c = "World"

print(b + c) # outputs "Hello-World"

Similar questions