Skip to main content
Engineering LibreTexts

2.9: String Operations

  • Page ID
    8543
  • The + operator works with strings, but it is not addition in the mathematical sense. Instead it performs concatenation, which means joining the strings by linking them end to end. For example:

    Code 2.9.1 (Python)
    first = 10
    second = 15
    print(first+second)
    
    first = '100'
    second = '150'
    print(first + second)
    
    
    

    The output of this program is 100150.

    • Was this article helpful?