# Additions.py Copyright (c) Kari Laitinen # http://www.naturalprogramming.com # 2006-05-28 File created. # 2016-11-17 Converted to Python 3. Last modification. # In Python, the + operator also works as a concatenation # operator that can concatenate strings, tuples, and lists. # The Python + operator does not, however, automatically # convert numerical values to strings. The standard # built-in function str() can be used to make these conversions. some_integer = 1234 print( "xxxx" + str( some_integer ) + "zzzz") print( "xxxx" + str( some_integer ) + str( some_integer ) + "zzzz") print( "xxxx" + str( some_integer + some_integer ) + "zzzz") print( str( some_integer + some_integer ) + "xxxx" + "zzzz") print( str( some_integer ) + ( str( some_integer ) + "xxxx" ) + "zzzz") print( "xxxx" + "zzzz" + str( some_integer ) + str( some_integer + 1 )) print( "xxxx" + "zzzz" + str( some_integer ) + str( some_integer ) + str( 1 ))