{"id":90019,"date":"2019-04-01T10:00:40","date_gmt":"2019-04-01T07:00:40","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=90019"},"modified":"2022-01-10T15:30:03","modified_gmt":"2022-01-10T13:30:03","slug":"python-string-append-example","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html","title":{"rendered":"Python String Append Example"},"content":{"rendered":"<p>In this article, we will explain the string append in Python.<\/p>\n<h2 class=\"wp-block-heading\">1. Introduction<\/h2>\n<p>In Python, the string is an immutable\u00a0object. You can use the &#8216;+&#8217;  operator to append two strings to create a new string. There are various ways such as using join, format, string IO,\u00a0and appending the strings with space.<\/p>\n<h2 class=\"wp-block-heading\">2. Python String Append<\/h2>\n<p>In this section, we will look at multiple ways of appending strings using python API.<\/p>\n<h3 class=\"wp-block-heading\">2.1 + operator<\/h3>\n<p>&#8216;+&#8217; Operator joins two strings. The code below shows appending of two strings with space in between.<\/p>\n<p><span style=\"text-decoration: underline\"><em>+ Operator<\/em><\/span><\/p>\n<pre class=\"brush:python\">str1 = \"Hello\"\nstr2 = \"World\"\nspace = \" \"\nprint(str1 + space + str2)\n<\/pre>\n<p>The command below tries to execute the above code snippet.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Run Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\"> python python_string_append.py\n<\/pre>\n<p>The output of the executed command is shown below. <\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"820\" height=\"450\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/hello_world.jpg\" alt=\"Python String Append - + operator\" class=\"wp-image-90026\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/hello_world.jpg 820w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/hello_world-300x165.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/hello_world-768x421.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>+ operator<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\">2.2 * operator<\/h3>\n<p>&#8216;*&#8217; Operator joins the string with int. The code snippet for using the &#8216;*&#8217; operator is shown below.<\/p>\n<p><span style=\"text-decoration: underline\"><em>* Operator<\/em><\/span><\/p>\n<pre class=\"brush:python\">print('black' * 5)\n<\/pre>\n<p>The command below executes the above code snippet.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Run Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\"> python python_string_append.py\n<\/pre>\n<p>The output of the executed command is shown below. <\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"820\" height=\"465\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/string_int.jpg\" alt=\"Python String Append - * operator\" class=\"wp-image-90027\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/string_int.jpg 820w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/string_int-300x170.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/string_int-768x436.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>* operator<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\">2.3 string appending to int<\/h3>\n<p>A string cannot be appended directly with int as shown in the snippet below.<\/p>\n<p><span style=\"text-decoration: underline\"><em>string appending to int<\/em><\/span><\/p>\n<pre class=\"brush:python\">print('green' + 8)\n<\/pre>\n<p>The command below executes the above code snippet.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Run Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\"> python python_string_append.py\n<\/pre>\n<p>The output of the executed command is shown below.  An exception occurs showing that string and int cannot be appended<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"820\" height=\"450\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/string_plus_int.jpg\" alt=\"Python String Append - Exception : str +int\" class=\"wp-image-90028\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/string_plus_int.jpg 820w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/string_plus_int-300x165.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/string_plus_int-768x421.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>Exception : str +int<\/figcaption><\/figure>\n<p>The right way is to use the str method to convert int to a string. The code snippet using the str method is shown below.<\/p>\n<p><span style=\"text-decoration: underline\"><em>string appending to int<\/em><\/span><\/p>\n<pre class=\"brush:python\">print('green' + str(8))\n<\/pre>\n<p>The command below executes the above code snippet.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Run Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\"> python python_string_append.py\n<\/pre>\n<p>The output of the executed command is shown below. <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"820\" height=\"450\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/string_str_int.jpg\" alt=\"Python String Append - int to string\" class=\"wp-image-90029\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/string_str_int.jpg 820w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/string_str_int-300x165.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/string_str_int-768x421.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>int to string<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\">2.4 % operator<\/h3>\n<p>&#8216;%&#8217; operator is used to append strings within a  string using format syntax. The code snippet for using the &#8216;%&#8217; operator is shown below.<\/p>\n<p><span style=\"text-decoration: underline\"><em>% operator<\/em><\/span><\/p>\n<pre class=\"brush:python\">fruit1 = 'grapes'\nfruit2 = 'apples'\nfruit3 = \"The basket has these fruits: %s and %s\" % (fruit1,fruit2)\n\nprint(fruit3)\n<\/pre>\n<p>The command below executes the above code snippet.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Run Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\"> python python_string_append.py\n<\/pre>\n<p>The output of the executed command is shown below. <\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"820\" height=\"465\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/operators.jpg\" alt=\"Python String Append - % operator\" class=\"wp-image-90030\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/operators.jpg 820w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/operators-300x170.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/operators-768x436.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>% operator<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\">2.5  format method<\/h3>\n<p>Format operator is used for appending strings within a string as shown in the code snippet below.<\/p>\n<p><span style=\"text-decoration: underline\"><em>format operator<\/em><\/span><\/p>\n<pre class=\"brush:python\">Firstname = \"Pierce\"\nLastname = \"Brosnan\"\nAge = \"54\"\nStr = \"{} {}'s Age is {} \".format(Firstname, Lastname, Age)\nprint(Str)\n\n<\/pre>\n<p>The command below executes the above code snippet.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Run Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\"> python python_string_append.py\n<\/pre>\n<p>The output of the executed command is shown below. <\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"820\" height=\"450\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/format.jpg\" alt=\"Python String Append - format method\" class=\"wp-image-90032\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/format.jpg 820w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/format-300x165.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/format-768x421.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>format method<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\">2.6  Join method<\/h3>\n<p>Another way to append strings is by creating a list and adding strings to the list.  The join method merges the strings together to get the result. The code snippet using the join method is shown below. <\/p>\n<p><span style=\"text-decoration: underline\"><em>Join method<\/em><\/span><\/p>\n<pre class=\"brush:python\">string = ' ' .join(['the', 'cat', 'jumps', 'over', 'the', 'wall'])\n\nprint(string)\n\n<\/pre>\n<p>The command below executes the above code snippet.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Run Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\"> python python_string_append.py\n<\/pre>\n<p>The output of the executed command is shown below. <\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/join_str.jpg\" alt=\"Python String Append - join method\" class=\"wp-image-90098\" width=\"580\" height=\"318\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/join_str.jpg 820w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/join_str-300x165.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/join_str-768x421.jpg 768w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><figcaption>Join method<\/figcaption><\/figure>\n<\/div>\n<p>Another example showing the join method appending strings in an array is presented below.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Join method<\/em><\/span><\/p>\n<pre class=\"brush:python\">music_album = [\"Stone Cold\",\"Metallica\", \"Rolling Stones\", \"One Dance\",\"Perfect Strangers\"]\nprint(\"\".join(music_album))\n\n<\/pre>\n<p>The command below executes the above code snippet.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Run Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\"> python python_string_append.py\n<\/pre>\n<p>The output of the executed command is shown below. <\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"820\" height=\"465\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/join_array-1.jpg\" alt=\"Python String Append - Join array\" class=\"wp-image-90128\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/join_array-1.jpg 820w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/join_array-1-300x170.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/join_array-1-768x436.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>Join array<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\">2.7 Concatenate with Space<\/h3>\n<p>The other way of appending the strings is to join a list of strings by including empty space. Concatenating with space is shown in the code snippet below.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Concatenate with space<\/em><\/span><\/p>\n<pre class=\"brush:python\">print ('Concatenate '  'With ' 'Space')\n\n<\/pre>\n<p>The command below executes the above code snippet.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Run Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\"> python python_string_append.py\n<\/pre>\n<p>The output of the executed command is shown below. <\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"820\" height=\"478\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/concatenate_with_space.jpg\" alt=\"Python String Append - concatenate with space\" class=\"wp-image-90099\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/concatenate_with_space.jpg 820w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/concatenate_with_space-300x175.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/concatenate_with_space-768x448.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>concatenate with space<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\" id=\"mce_13\">2.8 String io method<\/h3>\n<p>String IO is an in-memory stream for text input and output processing. The API is used to append strings. The code snippet shown below presents the string io usage.<\/p>\n<p><span style=\"text-decoration: underline\"><em>String io<\/em><\/span><\/p>\n<pre class=\"brush:python\">from io import StringIO\n \n \n \nconcat_str = StringIO()\n \n \n \nconcat_str.write('This ')\n \nconcat_str.write('example ')\n \nconcat_str.write('is ')\n \nconcat_str.write('for ')\n\nconcat_str.write('StringIO')\n \nprint(concat_str.getvalue())\n<\/pre>\n<p>The command below executes the above code snippet.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Run Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\"> python concat_string.py\n<\/pre>\n<p>The output of the executed command is shown below. <\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"820\" height=\"450\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/concat_string.jpg\" alt=\"Python String Append - string io\" class=\"wp-image-90103\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/concat_string.jpg 820w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/concat_string-300x165.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/concat_string-768x421.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>String IO<\/figcaption><\/figure>\n<h3 class=\"wp-block-heading\">2.9 Reading a log file<\/h3>\n<p>The code sample below shows reading lines from a log file and appending the string lines.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Reading a log file<\/em><\/span><\/p>\n<pre class=\"brush:python\">with open('log.txt') as file:\n    log_file = file.readlines()\n\nnew_log_lines = ''\nfor line in log_file:\n    if line[:6] == 'ERROR:':\n        new_log_lines = new_log_lines + line\n        \nprint(new_log_lines) \n<\/pre>\n<p>The log file text is shown below.<\/p>\n<p><span style=\"text-decoration: underline\"><em>log.txt<\/em><\/span><\/p>\n<pre class=\"brush:plain\">111.222.333.123 HOME - [01\/Feb\/1998:01:08:39 -0800] \"GET \/bannerad\/ad.htm HTTP\/1.0\" 200 198 \"http:\/\/www.mozmac.com\/ba_intro.htm\" \"Mozilla\/4.01 (Macintosh; I; PPC)\"\nERROR: link not working\n111.222.333.123 HOME - [01\/Feb\/1998:01:08:46 -0800] \"GET \/bannerad\/ad.htm HTTP\/1.0\" 200 28083 \"http:\/\/www.mozmac.com\/ba_intro.htm\" \"Mozilla\/4.01 (Macintosh; I; PPC)\"\n111.222.333.123 AWAY - [01\/Feb\/1998:01:08:53 -0800] \"GET \/bannerad\/ad7.gif HTTP\/1.0\" 200 9332 \"http:\/\/www.mozmac.com\/ba_ad.htm\" \"Mozilla\/4.01 (Macintosh; I; PPC)\"\nERROR: link not working\n111.222.333.123 AWAY - [01\/Feb\/1998:01:09:14 -0800] \"GET \/bannerad\/click.htm HTTP\/1.0\" 200 207 \"http:\/\/www.mozmac.com\/menu.htm\" \"Mozilla\/4.01 (Macintosh; I; PPC)\"\n<\/pre>\n<p>The command below executes the above code snippet.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Run Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\"> python python_line_append.py\n<\/pre>\n<p>The output of the executed command is shown below. <\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"820\" height=\"450\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/log_file.jpg\" alt=\"Python String Append - line appending\" class=\"wp-image-90104\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/log_file.jpg 820w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/log_file-300x165.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/log_file-768x421.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>line appending<\/figcaption><\/figure>\n<p>You can find more Python tutorials <a href=\"https:\/\/examples.javacodegeeks.com\/category\/python\/\">here<\/a>.<\/p>\n<h2 class=\"wp-block-heading\">3. Download the Source Code<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/03\/pythonstringappend-1.zip\"> <strong>Python String Append Example<\/strong><\/a><\/div>\n<p><strong>Last updated on Jan. 10th, 2022<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will explain the string append in Python. 1. Introduction In Python, the string is an immutable\u00a0object. You can use the &#8216;+&#8217; operator to append two strings to create a new string. There are various ways such as using join, format, string IO,\u00a0and appending the strings with space. 2. Python String Append &hellip;<\/p>\n","protected":false},"author":82890,"featured_media":219,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1878],"tags":[224],"class_list":["post-90019","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python String Append Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In Python, the string is an immutable\u00a0object. You can use the &#039;+&#039; operator to append two strings to create a new string.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/python-string-append-example.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python String Append Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In Python, the string is an immutable\u00a0object. You can use the &#039;+&#039; operator to append two strings to create a new string.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/python-string-append-example.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/bhagvank\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-01T07:00:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-10T13:30:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/python-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Bhagvan Kommadi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bhaggu\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bhagvan Kommadi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/python-string-append-example.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/python-string-append-example.html\"},\"author\":{\"name\":\"Bhagvan Kommadi\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/9caeec0195d2f7a298d4af138dcd90f3\"},\"headline\":\"Python String Append Example\",\"datePublished\":\"2019-04-01T07:00:40+00:00\",\"dateModified\":\"2022-01-10T13:30:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/python-string-append-example.html\"},\"wordCount\":639,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/python-string-append-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/python-logo.jpg\",\"keywords\":[\"Python\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/python-string-append-example.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/python-string-append-example.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/python-string-append-example.html\",\"name\":\"Python String Append Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/python-string-append-example.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/python-string-append-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/python-logo.jpg\",\"datePublished\":\"2019-04-01T07:00:40+00:00\",\"dateModified\":\"2022-01-10T13:30:03+00:00\",\"description\":\"In Python, the string is an immutable\u00a0object. You can use the '+' operator to append two strings to create a new string.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/python-string-append-example.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/python-string-append-example.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/python-string-append-example.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/python-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/python-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/python-string-append-example.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Development\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/web-development\\\/python\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Python String Append Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/9caeec0195d2f7a298d4af138dcd90f3\",\"name\":\"Bhagvan Kommadi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a98c5590df009be2bee75469ecbeef476c2167aae277ac576f89119b021d8e2d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a98c5590df009be2bee75469ecbeef476c2167aae277ac576f89119b021d8e2d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a98c5590df009be2bee75469ecbeef476c2167aae277ac576f89119b021d8e2d?s=96&d=mm&r=g\",\"caption\":\"Bhagvan Kommadi\"},\"description\":\"Bhagvan Kommadi is the Founder of Architect Corner &amp; has around 19 years experience in the industry, ranging from large scale enterprise development to helping incubate software product start-ups. He has done Masters in Industrial Systems Engineering at Georgia Institute of Technology (1997) and Bachelors in Aerospace Engineering from Indian Institute of Technology, Madras (1993). He is member of IFX forum,Oracle JCP and participant in Java Community Process. He founded Quantica Computacao, the first quantum computing startup in India. Markets and Markets have positioned Quantica Computacao in \u2018Emerging Companies\u2019 section of Quantum Computing quadrants. Bhagvan has engineered and developed simulators and tools in the area of quantum technology using IBM Q, Microsoft Q# and Google QScript.\",\"sameAs\":[\"http:\\\/\\\/www.architectcorner.com\",\"https:\\\/\\\/www.facebook.com\\\/bhagvank\",\"https:\\\/\\\/in.linkedin.com\\\/pub\\\/bhagvan-kommadi\\\/0\\\/3a6\\\/b46\",\"https:\\\/\\\/x.com\\\/bhaggu\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/bhagvan-kommadi\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python String Append Example - Java Code Geeks","description":"In Python, the string is an immutable\u00a0object. You can use the '+' operator to append two strings to create a new string.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html","og_locale":"en_US","og_type":"article","og_title":"Python String Append Example - Java Code Geeks","og_description":"In Python, the string is an immutable\u00a0object. You can use the '+' operator to append two strings to create a new string.","og_url":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_author":"https:\/\/www.facebook.com\/bhagvank","article_published_time":"2019-04-01T07:00:40+00:00","article_modified_time":"2022-01-10T13:30:03+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/python-logo.jpg","type":"image\/jpeg"}],"author":"Bhagvan Kommadi","twitter_card":"summary_large_image","twitter_creator":"@bhaggu","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Bhagvan Kommadi","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html"},"author":{"name":"Bhagvan Kommadi","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/9caeec0195d2f7a298d4af138dcd90f3"},"headline":"Python String Append Example","datePublished":"2019-04-01T07:00:40+00:00","dateModified":"2022-01-10T13:30:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html"},"wordCount":639,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/python-logo.jpg","keywords":["Python"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/python-string-append-example.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html","url":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html","name":"Python String Append Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/python-logo.jpg","datePublished":"2019-04-01T07:00:40+00:00","dateModified":"2022-01-10T13:30:03+00:00","description":"In Python, the string is an immutable\u00a0object. You can use the '+' operator to append two strings to create a new string.","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/python-string-append-example.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/python-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/python-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/python-string-append-example.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Development","item":"https:\/\/www.javacodegeeks.com\/category\/web-development"},{"@type":"ListItem","position":3,"name":"Python","item":"https:\/\/www.javacodegeeks.com\/category\/web-development\/python"},{"@type":"ListItem","position":4,"name":"Python String Append Example"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/9caeec0195d2f7a298d4af138dcd90f3","name":"Bhagvan Kommadi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a98c5590df009be2bee75469ecbeef476c2167aae277ac576f89119b021d8e2d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a98c5590df009be2bee75469ecbeef476c2167aae277ac576f89119b021d8e2d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a98c5590df009be2bee75469ecbeef476c2167aae277ac576f89119b021d8e2d?s=96&d=mm&r=g","caption":"Bhagvan Kommadi"},"description":"Bhagvan Kommadi is the Founder of Architect Corner &amp; has around 19 years experience in the industry, ranging from large scale enterprise development to helping incubate software product start-ups. He has done Masters in Industrial Systems Engineering at Georgia Institute of Technology (1997) and Bachelors in Aerospace Engineering from Indian Institute of Technology, Madras (1993). He is member of IFX forum,Oracle JCP and participant in Java Community Process. He founded Quantica Computacao, the first quantum computing startup in India. Markets and Markets have positioned Quantica Computacao in \u2018Emerging Companies\u2019 section of Quantum Computing quadrants. Bhagvan has engineered and developed simulators and tools in the area of quantum technology using IBM Q, Microsoft Q# and Google QScript.","sameAs":["http:\/\/www.architectcorner.com","https:\/\/www.facebook.com\/bhagvank","https:\/\/in.linkedin.com\/pub\/bhagvan-kommadi\/0\/3a6\/b46","https:\/\/x.com\/bhaggu"],"url":"https:\/\/www.javacodegeeks.com\/author\/bhagvan-kommadi"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/90019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/82890"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=90019"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/90019\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/219"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=90019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=90019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=90019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}