STRING ADDITION IN PYTHON – CONCATENATION

Photo of author

By Jackson Taylor

Home » Topic » Python & OpenCv » STRING ADDITION IN PYTHON – CONCATENATION

Program

a='222';
b='333';
print b+a;
a='EMER';
b='GING';
print a+b;

Because both values are strings, b+a prints 333222 rather than adding the numbers, and a+b prints EMERGING. To check how many characters a joined string ends up with, paste it into our string length counter; more small helpers for programmers are in the free online tools collection.

YouTube video
See also
LED CONTROLLING USING ARDUINO AND PYTHON

Revive Your Dead Electronics

Got a drawer full of dead gadgets or a failing car battery? Instead of paying a premium for replacements, use this simple trick to easily recondition them right from home.

See How It Works