{"id":391,"date":"2017-01-04T22:50:49","date_gmt":"2017-01-04T13:50:49","guid":{"rendered":"http:\/\/www.python.ambitious-engineer.com\/?p=391"},"modified":"2021-02-07T22:00:52","modified_gmt":"2021-02-07T13:00:52","slug":"print%e9%96%a2%e6%95%b0","status":"publish","type":"post","link":"https:\/\/www.python.ambitious-engineer.com\/archives\/391","title":{"rendered":"print\u95a2\u6570"},"content":{"rendered":"<p>\u3053\u306e\u30da\u30fc\u30b8\u3067\u306f\u3001\u4eca\u5f8c\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u983b\u7e41\u306b\u4f7f\u7528\u3059\u308bprint\u95a2\u6570\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u3044\u304f\u3064\u304b\u89e3\u8aac\u3057\u3066\u3044\u306a\u3044\u7528\u8a9e\u304c\u767b\u5834\u3057\u307e\u3059\u304c\u3001\u305d\u308c\u3089\u306f\u5f8c\u65b9\u306e\u30da\u30fc\u30b8\u3067\u6539\u3081\u3066\u89e3\u8aac\u3057\u307e\u3059\u306e\u3067\u4e00\u65e6\u8aad\u307f\u9032\u3081\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>print\u95a2\u6570\u306e\u57fa\u672c<\/h2>\n<p>Python\u306b\u306f\u4e88\u3081\u7528\u610f\u3055\u308c\u3044\u308b\u95a2\u6570\u304c\u3042\u308a\u3001\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u3068\u547c\u3070\u308c\u3066\u3044\u307e\u3059\u3002print\u95a2\u6570\u306f\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u306e1\u3064\u3067\u3001\u5f15\u6570\u306b\u6307\u5b9a\u3057\u305f\u5909\u6570\u3084\u5024\u306e\u6587\u5b57\u5217\u8868\u73fe\u3092\u6a19\u6e96\u51fa\u529b\u306b\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<div class=\"c_box intitle yellow_box\"><div class=\"box_title\"><span>print\u95a2\u6570<\/span><\/div>\nprint(\u50241&nbsp;, \u50242&nbsp;, \u30fb\u30fb\u30fb,&nbsp;end=\"\u7d42\u7aef\u6587\u5b57\")<br \/>\n<\/div>\n<p>\u5225\u30da\u30fc\u30b8\u3067\u8a73\u3057\u304f\u8aac\u660e\u3057\u307e\u3059\u304c\u3001Python\u306e\u6587\u5b57\u5217\u306f\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\u304b\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\u3067\u56f2\u307f\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u6587\u5b57\u5217\u300cSample\u300d\u3092\u51fa\u529b\u3057\u305f\u3044\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nprint(&quot;Sample&quot;)\r\n<\/pre>\n<p>\u307e\u305f\u3001\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u5024\u3092\u6307\u5b9a\u3059\u308b\u3068\u30b9\u30da\u30fc\u30b9\u533a\u5207\u308a\u3067\u5217\u6319\u3055\u308c\u307e\u3059\u3002\u3044\u304f\u3064\u304b\u8ffd\u52a0\u3067\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nprint('\u30b5\u30f3\u30d7\u30eb\u6587\u5b57\u5217') # '\u30b5\u30f3\u30d7\u30eb\u6587\u5b57\u5217'\u304c\u51fa\u529b\u3055\u308c\u308b\r\n\r\nx = 'text'\r\nprint(x) # 'text'\u304c\u51fa\u529b\u3055\u308c\u308b\r\n\r\ny = 100\r\nprint(y) # 100\u304c\u51fa\u529b\u3055\u308c\u308b\r\n\r\nprint(x, y) # text 100\u304c\u51fa\u529b\u3055\u308c\u308b\r\n\r\n<\/pre>\n<h2>print\u95a2\u6570\u3067\u6539\u884c\u3055\u305b\u305f\u304f\u306a\u3044\u5834\u5408<\/h2>\n<p>print\u95a2\u6570\u306e\u5f15\u6570\u3067end\u5f15\u6570\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u51fa\u529b\u3059\u308b\u6587\u5b57\u5217\u306e\u7d42\u7aef\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002print\u95a2\u6570\u3067\u306f\u6539\u884c\u304c\u81ea\u52d5\u7684\u306b\u884c\u308f\u308c\u307e\u3059\u304c\u3001\u6539\u884c\u3055\u305b\u305f\u304f\u306a\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306bend\u5f15\u6570\u306b\u7a7a\u767d\u6587\u5b57\u3001\u3064\u307e\u308a\"\"\u3084''\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nprint('aaa', end='')\r\nprint('bbb')\r\n<\/pre>\n<p><strong>\u5b9f\u884c\u7d50\u679c<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\naaabbb\r\n<\/pre>\n<p>\u7121\u8ad6\u3001\u4ed6\u306e\u6587\u5b57\u5217\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001aaa,bbb,ccc\u3092\u2605\u3067\u7d50\u5408\u3057\u3066\u3001\u6700\u5f8c\u306b\u6539\u884c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nprint('aaa', end='\u2605')\r\nprint('bbb', end='\u2605')\r\nprint('ccc')\r\n<\/pre>\n<p><strong>\u5b9f\u884c\u7d50\u679c<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\naaa\u2605bbb\u2605ccc\r\n<\/pre>\n<h2>\u6587\u5b57\u5217\u7d50\u5408\u3068str\u95a2\u6570<\/h2>\n<p>\u3044\u304f\u3064\u304b\u306e\u5909\u6570\u3092\u7d9a\u3051\u3066\u8868\u793a\u305b\u305f\u3044\u5834\u5408\u3001+\u8a18\u53f7\u3067\u6587\u5b57\u5217\u3092\u7d50\u5408\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nx1 = 'text'\r\nx2 = 'mojiretsu'\r\nprint(x1 + ' ' + x2) # text mojiretsu\u304c\u51fa\u529b\u3055\u308c\u308b\r\n<\/pre>\n<p>\u305f\u3060\u3057\u3001<strong>\u6587\u5b57\u5217\u4ee5\u5916\u3092\u7d50\u5408\u3059\u308b\u5834\u5408\u306f\u6ce8\u610f\u304c\u5fc5\u8981<\/strong>\u3067\u3059\u3002\u6570\u5024\u3068\u6587\u5b57\u5217\u3092+\u3067\u7d50\u5408\u3059\u308b\u65b9\u6cd5\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306f\u30a8\u30e9\u30fc\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nx = 'text'\r\ny = 100\r\nprint(x + y) # TypeError: Can't convert 'int' object to str implicitly\r\n\r\n<\/pre>\n<p>\u3053\u306e\u5834\u5408\u3001\u4e00\u65e6\u6570\u5024\u306b\u5bfe\u3057\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u306estr\u3067\u6587\u5b57\u5217\u5909\u63db\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u7d50\u5408\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002\u5c11\u3057\u6b63\u78ba\u6027\u3092\u72a0\u7272\u306b\u3057\u307e\u3059\u304c\u3001\u5f53\u9762\u306fstr\u95a2\u6570\u306f\u4efb\u610f\u306e\u5909\u6570\u3092\u6587\u5b57\u5217\u5316\u3059\u308b\u95a2\u6570\u3060\u3068\u8003\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nx = 'text'\r\ny = 100 \r\nprint(x + str(y)) # text100\u304c\u51fa\u529b\u3055\u308c\u308b\r\n<\/pre>\n<h2>print\u3067\u8272\u3092\u3064\u3051\u308b<\/h2>\n<p>ANSI\u30a8\u30b9\u30b1\u30fc\u30d7\u30b7\u30fc\u30b1\u30f3\u30b9\u3092\u4f7f\u7528\u3059\u308b\u3068print\u3067\u8272\u3092\u4ed8\u3051\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\u8a73\u3057\u304f\u306f\u4ee5\u4e0b\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"related_article cf\"><a href=\"https:\/\/www.python.ambitious-engineer.com\/archives\/3721\" class=\"cf\"><figure class=\"eyecatch thum\"><img width=\"300\" height=\"200\" src=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2021\/11\/eyecatch_print_color-300x200.png\" class=\"attachment-home-thum size-home-thum wp-post-image\" alt=\"\" loading=\"lazy\" \/><\/figure><div class=\"meta inbox\"><p class=\"ttl\">print\u3067\u8272\u3092\u3064\u3051\u308b\u65b9\u6cd5<\/p><span class=\"date\">2021\u5e7411\u670820\u65e5<\/span><\/div><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u30da\u30fc\u30b8\u3067\u306f\u3001\u4eca\u5f8c\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u983b\u7e41\u306b\u4f7f\u7528\u3059\u308bprint\u95a2\u6570\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u3044\u304f\u3064\u304b\u89e3\u8aac\u3057\u3066\u3044\u306a\u3044\u7528\u8a9e\u304c\u767b\u5834\u3057\u307e\u3059\u304c\u3001\u305d\u308c\u3089\u306f\u5f8c\u65b9\u306e\u30da\u30fc\u30b8\u3067\u6539\u3081\u3066\u89e3\u8aac\u3057\u307e\u3059\u306e\u3067\u4e00\u65e6\u8aad\u307f\u9032\u3081\u3066\u304f\u3060\u3055\u3044\u3002 print\u95a2\u6570\u306e\u57fa\u672c Py...<\/p>\n","protected":false},"author":1,"featured_media":3148,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[136],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/391"}],"collection":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/comments?post=391"}],"version-history":[{"count":6,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/391\/revisions"}],"predecessor-version":[{"id":3738,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/391\/revisions\/3738"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/media\/3148"}],"wp:attachment":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/media?parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/categories?post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/tags?post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}