{"id":511,"date":"2018-08-08T13:47:53","date_gmt":"2018-08-08T04:47:53","guid":{"rendered":"https:\/\/python-introduction.com\/?p=511"},"modified":"2018-08-08T13:47:53","modified_gmt":"2018-08-08T04:47:53","slug":"%e3%80%90python%e3%80%91format%e9%96%a2%e6%95%b0%e3%81%a7%e5%ae%9f%e7%8f%be%e3%81%a7%e3%81%8d%e3%82%8b%e4%be%bf%e5%88%a9%e3%81%aa%e4%bd%bf%e3%81%84%e6%96%b9","status":"publish","type":"post","link":"https:\/\/python-introduction.com\/?p=511","title":{"rendered":"\u3010Python\u3011format\u95a2\u6570\u3067\u5b9f\u73fe\u3067\u304d\u308b\u4fbf\u5229\u306a\u4f7f\u3044\u65b9"},"content":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u3067\u306fformat\u95a2\u6570\u3067\u5b9f\u73fe\u3067\u304d\u308b\u4fbf\u5229\u306a\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066<br \/>\n\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001format\u95a2\u6570\u3092\u4f7f\u3048\u3070<br \/>\n\u3042\u306a\u305f\u306e\u601d\u3044\u901a\u308a\u306e\u5834\u6240\u306b<br \/>\n\u6587\u5b57\u5217\u3092\u4ee3\u5165\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u672c\u984c\u306b\u5165\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#Pythonformat\"><span class=\"toc_number toc_depth_1\">1<\/span> \u3010Python\u3011format\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u57fa\u672c<\/a><\/li><li><a href=\"#Pythonformat-2\"><span class=\"toc_number toc_depth_1\">2<\/span> \u3010Python\u3011format\u95a2\u6570\u306e\u4f7f\u3044\u65b9\uff08\u8907\u6570\u306e{}\u304c\u3042\u308b\u30d1\u30bf\u30fc\u30f3\uff09<\/a><\/li><li><a href=\"#Pythonformat-3\"><span class=\"toc_number toc_depth_1\">3<\/span> \u3010Python\u3011format\u95a2\u6570\u306e\u4f7f\u3044\u65b9\uff08\u4ee3\u5165\u3059\u308b\u9806\u756a\u3092\u5165\u308c\u66ff\u3048\u308b\uff09<\/a><\/li><li><a href=\"#Pythonformat-4\"><span class=\"toc_number toc_depth_1\">4<\/span> \u3010Python\u3011format\u95a2\u6570\u306e\u4f7f\u3044\u65b9\uff5c\u5909\u6570\u3092\u5229\u7528\u3059\u308b<\/a><\/li><li><a href=\"#Python\"><span class=\"toc_number toc_depth_1\">5<\/span> Python\u3067\u578b\u5909\u63db\u3059\u308b\u65b9\u6cd5<\/a><\/li><\/ul><\/div>\n<h2><span id=\"Pythonformat\">\u3010Python\u3011format\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u57fa\u672c<\/span><\/h2>\n<p>\u307e\u305aformat\u95a2\u6570\u3092\u4f7f\u3063\u305f\u4f8b\u984c\u304b\u3089\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c1\r\na = '\u975e\u6b63\u898f\u52b4\u50cd\u8005\u306b{}'.format('\u306a\u308a\u305f\u304f\u306a\u3044\u3002')\r\nprint(a)<\/pre>\n<p>\u4e0a\u8a18\u3067\u3001print\u3068\u304b\u300ea =\u300f\u3068\u304b\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u65b9\u306f<br \/>\n\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u5148\u306b\u8aad\u3093\u3067\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u21d2<a href=\"https:\/\/python-introduction.com\/?p=416\" target=\"blank\">\u3010Python\u5165\u9580\u3011\u5909\u6570\u306e\u4ee3\u5165\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a><br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=174\" target=\"blank\">\u3010python\u3011print\u3067\u6587\u5b57\u5217\u3092\u6539\u884c\u3059\u308b\u65b9\u6cd5\u3068\u6539\u884c\u3057\u306a\u3044\u65b9\u6cd5<\/a><\/p>\n<p>\u8a71\u3092\u5143\u623b\u3057\u307e\u3059\u306d\u3002<\/p>\n<p>\u4f8b\u984c1\u3092\u5b9f\u884c\u3059\u308b\u3068<br \/>\n\u300e\u975e\u6b63\u898f\u52b4\u50cd\u8005\u306b\u306a\u308a\u305f\u304f\u306a\u3044\u300f\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formatsann807.jpg\" alt=\"format\u95a2\u6570\" width=\"395\" height=\"120\" class=\"alignnone size-full wp-image-515\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formatsann807.jpg 395w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formatsann807-300x91.jpg 300w\" sizes=\"(max-width: 395px) 100vw, 395px\" \/><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">.format('\u306a\u308a\u305f\u304f\u306a\u3044\u3002')<\/pre>\n<p>\u3068format\u306e\u4e2d\u306b\u5165\u3063\u3066\u3044\u308b\u6587\u5b57\u5217\u3092<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">'\u975e\u6b63\u898f\u52b4\u50cd\u8005\u306b{}'<\/pre>\n<p>\u306e\u4e2d\u306e{}\u306b\u4ee3\u5165\u3055\u305b\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3092\u5909\u6570a\u306b\u4ee3\u5165\u3057<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">print(a)<\/pre>\n<p>\u306b\u3088\u3063\u3066<br \/>\n\u5909\u6570a\u306b\u5165\u3063\u305f\u300e\u975e\u6b63\u898f\u52b4\u50cd\u8005\u306b\u306a\u308a\u305f\u304f\u306a\u3044\u300f\u3068\u3044\u3046\u6587\u5b57\u5217\u3092<br \/>\n\u8868\u793a\u3055\u305b\u3066\u3044\u308b\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>\u300c\u5909\u6570a\u306b\u4ee3\u5165\u3068\u304b\u3001\u3088\u304f\u308f\u304b\u3093\u306a\u3044\u3088\u300d\u3068\u3044\u3046\u65b9\u3001<br \/>\n\u5148\u306b\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=416\" target=\"blank\">\u3010Python\u5165\u9580\u3011\u5909\u6570\u306e\u4ee3\u5165\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a><\/p>\n<p>\u6b21\u306b\u4f8b\u984c2\u3092\u4f7f\u3063\u3066\u3001<br \/>\n\u4e0a\u8a18\u306e\u3053\u3068\u304c\u7406\u89e3\u3067\u304d\u305f\u304b\u3001<br \/>\n\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c2\r\nb = '\u975e\u6b63\u898f\u52b4\u50cd\u8005\u306b{}'.format('\u306a\u3063\u3061\u3083\u3063\u305f\u3002')\r\nprint(b)<\/pre>\n<p>\u4f8b\u984c2\u3067\u306f\u5909\u6570b\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u304c<br \/>\n\u4f8b\u984c1\u3068\u8003\u3048\u65b9\u306f\u307e\u3063\u305f\u304f\u540c\u3058\u3067\u3059\u3002<\/p>\n<p>format\u95a2\u6570\u306b\u5165\u3063\u3066\u3044\u308b&#8217;\u306a\u3063\u3061\u3083\u3063\u305f\u3002&#8217;\u3092<br \/>\n&#8216;\u975e\u6b63\u898f\u52b4\u50cd\u8005\u306b{}&#8217;\u306e{}\u306b\u4ee3\u5165\u3057<br \/>\n\u305d\u308c\u3092\u5909\u6570b\u306b\u4ee3\u5165\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u7d50\u679c\u3001<br \/>\n\u300e\u975e\u6b63\u898f\u52b4\u50cd\u8005\u306b\u306a\u3063\u3061\u3083\u3063\u305f\u3002\u300f<br \/>\n\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/hiseikirou807.jpg\" alt=\"format\u95a2\u6570\u306e\u5177\u4f53\u4f8b\" width=\"395\" height=\"120\" class=\"alignnone size-full wp-image-518\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/hiseikirou807.jpg 395w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/hiseikirou807-300x91.jpg 300w\" sizes=\"(max-width: 395px) 100vw, 395px\" \/><\/p>\n<h2><span id=\"Pythonformat-2\">\u3010Python\u3011format\u95a2\u6570\u306e\u4f7f\u3044\u65b9\uff08\u8907\u6570\u306e{}\u304c\u3042\u308b\u30d1\u30bf\u30fc\u30f3\uff09<\/span><\/h2>\n<p>\u4f8b\u984c1\u3068\u4f8b\u984c2\u3067format\u95a2\u6570\u306e\u57fa\u672c\u304c\u308f\u304b\u3063\u305f\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u3067\u306f\u6b21\u306b\u3001{}\u304c\u8907\u6570\u3042\u308b\u5834\u5408\u306e\u5177\u4f53\u4f8b\u3092\u307f\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c3\r\nc = '\u975e\u6b63\u898f\u52b4\u50cd\u8005\u306b{}{}{}'.format('\u306a\u308b','\u304b\u3082','\u3057\u308c\u306a\u3044\u3002')\r\nprint(c)<\/pre>\n<p>\u4f8b\u984c3\u3067\u306f{}\u304c3\u3064\u3042\u308a\u307e\u3059\u306d\u3002<br \/>\nformat\u306e\u4e2d\u306b\u3082<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">format('\u306a\u308b','\u304b\u3082','\u3057\u308c\u306a\u3044\u3002')<\/pre>\n<p>\u30b7\u30f3\u30b0\u30eb\u30af\u30aa\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\uff08&#8217;\uff09\u3067\u56f2\u307e\u308c\u305f\u6587\u5b57\u5217\u304c<br \/>\n\u300e&#8217;\u306a\u308b&#8217;\u300f,\u300e&#8217;\u304b\u3082&#8217;\u300f,\u300e&#8217;\u3057\u308c\u306a\u3044\u3002&#8217;\u300f\u30683\u3064\u5165\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u984c3\u3092\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<p>\u300e\u975e\u6b63\u898f\u52b4\u50cd\u8005\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3002\u300f\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formatthuku807.jpg\" alt=\"\u8907\u6570\u306e{}\" width=\"513\" height=\"103\" class=\"alignnone size-full wp-image-519\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formatthuku807.jpg 513w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formatthuku807-300x60.jpg 300w\" sizes=\"(max-width: 513px) 100vw, 513px\" \/><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3001{}{}{}\u30683\u3064\u3042\u3063\u305f\u5834\u5408\u3001<br \/>\n\u5f8c\u308d\u306eformat\u95a2\u6570\u306b\u5165\u3063\u305f\u6587\u5b57\u5217\u3092\u524d\u304b\u3089\u9806\u756a\u306b<br \/>\n\u4ee3\u5165\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306e{}\u306b\u300e\u306a\u308b\u300f\u304c\u3001<br \/>\n\u6b21\u306e{}\u306b\u300e\u304b\u3082\u300f\u304c<br \/>\n\u4e09\u756a\u76ee\u306e{}\u306b\u300e\u3057\u308c\u306a\u3044\u3002\u300f\u304c<br \/>\n\u305d\u308c\u305e\u308c\u5165\u3063\u305f\u7d50\u679c\u3001<br \/>\n\u300e\u975e\u6b63\u898f\u52b4\u50cd\u8005\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3002\u300f<br \/>\n\u3068\u306a\u3063\u305f\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<h2><span id=\"Pythonformat-3\">\u3010Python\u3011format\u95a2\u6570\u306e\u4f7f\u3044\u65b9\uff08\u4ee3\u5165\u3059\u308b\u9806\u756a\u3092\u5165\u308c\u66ff\u3048\u308b\uff09<\/span><\/h2>\n<p>\u3053\u3053\u3067\u3001\u300c\u3058\u3083\u3001{}{}{}\u3068\u3042\u3063\u305f\u3089\u5fc5\u305a<br \/>\n\u9806\u756a\u306b\u3057\u304b\u6587\u5b57\u5217\u3092\u4ee3\u5165\u3067\u304d\u306a\u3044\u306e\uff1f<br \/>\nAI\u306e\u6642\u4ee3\u306b\u305d\u3093\u306a\u306b\u878d\u901a\u304c\u5229\u304b\u306a\u3044\u306e\uff1f\u300d<br \/>\n\u3068\u7591\u554f\u306b\u611f\u3058\u305f\u65b9\u3082\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>AI\u306e\u6642\u4ee3\u3067\u3059\u304b\u3089\u306d\u3002<\/p>\n<p>\u4ee3\u5165\u3059\u308b\u9806\u756a\u3092\u5165\u308c\u66ff\u3048\u308b\u3053\u3068\u306f\u53ef\u80fd\u3067\u3059\u3088\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c4\r\nc = '\u975e\u6b63\u898f\u52b4\u50cd\u8005\u306b{2}{0}{1}'.format('\u306a\u308b','\u304b\u3082','\u3057\u308c\u306a\u3044\u3002')\r\nprint(c)<\/pre>\n<p>python\u3067\u306f\u6570\u5b57\u3092\u6570\u3048\u308b\u3068\u304d<br \/>\n0\u304b\u3089\u6570\u3048\u307e\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067{}\u306b\u4ee3\u5165\u3059\u308b\u9806\u756a\u30820,1,2,\u30fb\u30fb\u30fb<br \/>\n\u3068\u8003\u3048\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3067\u3001\u4f8b\u984c4\u306e\u3088\u3046\u306b{}\u306e\u4e2d\u306b\u6587\u5b57\u5217\u3092\u4ee3\u5165\u3059\u308b\u9806\u756a\u3092<br \/>\n\u6307\u5b9a\u3057\u3066\u304a\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068<br \/>\n\u300e\u975e\u6b63\u898f\u52b4\u50cd\u8005\u306b\u3057\u308c\u306a\u3044\u3002\u306a\u308b\u304b\u3082\u300f\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formaythuii807.jpg\" alt=\"format\u95a2\u6570\" width=\"517\" height=\"103\" class=\"alignnone size-full wp-image-522\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formaythuii807.jpg 517w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formaythuii807-300x60.jpg 300w\" sizes=\"(max-width: 517px) 100vw, 517px\" \/><\/p>\n<p>{2}\u306b\u300e\u3057\u308c\u306a\u3044\u3002\u300f\u304c{0}\u306b\u300e\u306a\u308b\u300f\u304c{1}\u306b\u300e\u304b\u3082\u300f\u304c<br \/>\n\u305d\u308c\u305e\u308c\u4ee3\u5165\u3055\u308c\u305f\u3063\u3066\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u3053\u308c\u306f\u3069\u3046\u3067\u3057\u3087\u3046\uff1f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c5\r\nc = '\u30d5\u30e9\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u3067{2}{0}{1}{3}'.format('\u4e0a\u304c\u308a','\u305d\u3046\u306b','\u5fc3\u62cd\u6570\u304c','\u306a\u3063\u3066\u3044\u308b')\r\nprint(c)<\/pre>\n<p>\u4eca\u5ea6\u306f{}\u304c4\u3064\u3042\u308b\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u306d\u3002<\/p>\n<p>\u300e\u30d5\u30e9\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u3067\u5fc3\u62cd\u6570\u304c\u4e0a\u304c\u308a\u305d\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u300f<br \/>\n\u3068\u3044\u3046\u6587\u7ae0\u3092\u5b8c\u6210\u3055\u305b\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">'\u30d5\u30e9\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u3067{2}{0}{1}{3}'<\/pre>\n<p>\u3068\u3044\u3046\u9806\u756a\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u9806\u756a\u306f0,1,2,3\u3068\u306a\u308a\u307e\u3059\u304b\u3089\u3002<\/p>\n<p>{2}\u306f\u300e\u5fc3\u62cd\u6570\u304c\u300f\u3001{0}\u306f\u300e\u4e0a\u304c\u308a\u300f\u3001<br \/>\n{1}\u306f\u300e\u305d\u3046\u306b\u300f\u3001{3}\u306f\u300e\u306a\u3063\u3066\u3044\u308b\u3002\u300f<br \/>\n\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formatkan808.jpg\" alt=\"format\" width=\"633\" height=\"100\" class=\"alignnone size-full wp-image-525\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formatkan808.jpg 633w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formatkan808-300x47.jpg 300w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formatkan808-630x100.jpg 630w\" sizes=\"(max-width: 633px) 100vw, 633px\" \/><\/p>\n<p>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2><span id=\"Pythonformat-4\">\u3010Python\u3011format\u95a2\u6570\u306e\u4f7f\u3044\u65b9\uff5c\u5909\u6570\u3092\u5229\u7528\u3059\u308b<\/span><\/h2>\n<p>\u3067\u306f\u6b21\u306b\u5909\u6570\u3092\u4f7f\u3063\u305f\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<p>\u300c\u5909\u6570\u3063\u3066\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u300d<br \/>\n\u3068\u3044\u3046\u65b9\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"linkcard\"><table border=\"1\" cellspacing=\"0\" cellpadding=\"4\"><tbody><\/tr><tr><td>\u3053\u306e\u8a18\u4e8b\u3067\u306fPython\u306b\u304a\u3051\u308b\u5909\u6570\u306e\u4ee3\u5165\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002\u307e\u305a\u3001\u5909\u6570\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3042\u308f\u305b\u3066\u3054\u89a7\u304f\u3060\u3055\u3044\u3002\u21d2Python\u306e\u5909\u6570\u5ba3\u8a00\u3067\u6ce8\u610f\u3059\u3079\u304d\u3053\u3068\u3053\u306e\u8a18\u4e8b\u3067\u306fJupyter Notebook\u3092\u4f7f\u3063\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002\u21d2Jupyter Notebook\u306e\u4f7f\u3044\u65b9\u3010Python\u5165...<br><a class=\"no_icon\" href=\"https:\/\/python-introduction.com\/?p=416\">\u3010Python\u5165\u9580\u3011\u5909\u6570\u306e\u4ee3\u5165\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a> - python\u5165\u9580\u30c9\u30c3\u30c8\u30b3\u30e0<\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u305d\u308c\u3067\u306f\u4f8b\u984c\u3092\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c6\r\nc = '\u501f\u91d1\u3067{namae}{josi}{dousi}'.format(namae='\u592a\u90ce\u541b',josi='\u306f',dousi='\u7834\u7523\u3057\u305f\u3002')\r\nprint(c)<\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formatsaka808.jpg\" alt=\"format\" width=\"612\" height=\"94\" class=\"alignnone size-full wp-image-528\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formatsaka808.jpg 612w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/formatsaka808-300x46.jpg 300w\" sizes=\"(max-width: 612px) 100vw, 612px\" \/><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067<br \/>\n\u300enamae\u300f\u3001\u300ejosi\u300f\u3001\u300edousi\u300f<br \/>\n\u3068\u3044\u3046\u5909\u6570\u306e\u4e2d\u306bformat\u95a2\u6570\u3092\u4f7f\u3063\u3066<br \/>\n\u6587\u5b57\u5217\u3092\u4ee3\u5165\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>namae\u3068\u3044\u3046\u5909\u6570\u306e\u4e2d\u306b\u300e\u592a\u90ce\u541b\u300f<br \/>\njosi\u3068\u3044\u3046\u5909\u6570\u306e\u4e2d\u306b\u300e\u306f\u300f<br \/>\ndousi\u3068\u3044\u3046\u5909\u6570\u306e\u4e2d\u306b\u300e\u7834\u7523\u3057\u305f\u3002\u300f<br \/>\n\u3092\u305d\u308c\u305e\u308c\u4ee3\u5165\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u3001\u6b21\u306f\u6570\u5b57\u3092\u4ee3\u5165\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\nformat\u95a2\u6570\u306f\u6587\u5b57\u5217\u3060\u3051\u3067\u306a\u304f\u3001<br \/>\n\u6570\u5b57\u3082\u4ee3\u5165\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c7\r\nc = '\u305b\u30fc\u306e\uff01{namae}{josi}{dousi}'.format(namae=1,josi=2,dousi=3)\r\nprint(c)<\/pre>\n<p>\u4f8b\u984c7\u306e\u3088\u3046\u306b\u6570\u5b57\u3092\u4ee3\u5165\u3059\u308b\u3068\u304d\u306b\u306f<br \/>\n\u30b7\u30f3\u30b0\u30eb\u30af\u30aa\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\uff08&#8217;)\u3084<br \/>\n\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\uff08&#8221;)\u306f<br \/>\n\u5916\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4f8b\u984c6\u3067\u306fnamae=&#8217;\u592a\u90ce\u541b&#8217;\u3068<br \/>\n\u592a\u90ce\u541b\u3092\u30b7\u30f3\u30b0\u30eb\u30af\u30aa\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3063\u3066\u307e\u3057\u305f\u306d\u3002<br \/>\n\u3067\u3082\u3001\u4f8b\u984c7\u3067\u306fnamae=1\u3068<br \/>\n\u30b7\u30f3\u30b0\u30eb\u30af\u30aa\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u56f2\u3063\u3066\u306a\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u3053\u308c\u304c\u6570\u5b57\u3068\u6587\u5b57\u5217\u306e\u6271\u3044\u65b9\u306e\u9055\u3044\u3067\u3059\u3002<\/p>\n<h2><span id=\"Python\">Python\u3067\u578b\u5909\u63db\u3059\u308b\u65b9\u6cd5<\/span><\/h2>\n<p>\u3053\u3053\u304b\u3089\u306f\u88dc\u8db3\u306a\u306e\u3067\u3059\u304c\u3002<\/p>\n<p>\u6570\u5b57\u306e1\u3092\u6587\u5b57\u5217\u306b\u5909\u63db\u3057\u305f\u308a<br \/>\n\u6587\u5b57\u5217\u3092\u6570\u6642\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u3092\u578b\u5909\u63db\u3068\u3044\u3044\u307e\u3059\u3002<\/p>\n<p>\u5148\u307b\u3069\u3082\u89e3\u8aac\u3057\u307e\u3057\u305f\u304c<br \/>\n\u6587\u5b57\u5217\u3068\u6570\u5b57\u3067\u306f\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3092<br \/>\n\u3064\u3051\u305f\u308a\u3064\u3051\u306a\u304b\u3063\u305f\u308a\u3068<br \/>\n\u51e6\u7406\u306e\u4ed5\u65b9\u304c\u9055\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001\u578b\u5909\u63db\u306e\u4ed5\u65b9\u3092\u77e5\u3063\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u305f\u3060\u3001\u305d\u3082\u305d\u3082\u300c\u578b\u3063\u3066\u4f55\uff1f\u300d<br \/>\n\u3068\u7591\u554f\u306b\u611f\u3058\u3066\u3044\u308b\u65b9\u306f<br \/>\n\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u5148\u306b\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"linkcard\"><table border=\"1\" cellspacing=\"0\" cellpadding=\"4\"><tbody><\/tr><tr><td>\u3053\u3053\u307e\u3067\u306e\u8a18\u4e8b\u3067Python\u5165\u9580\u7de8\u3068\u3057\u3066\u5909\u6570\u306b\u3064\u3044\u3066\u305f\u304f\u3055\u3093\u89e3\u8aac\u3057\u3066\u304d\u307e\u3057\u305f\u3002\u307e\u3060\u898b\u3066\u306a\u3044\u65b9\u306f\u5148\u306b\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002\u21d2Python\u306e\u5909\u6570\u5ba3\u8a00\u3067\u6ce8\u610f\u3059\u3079\u304d\u3053\u3068\u21d2\u3010Python\u5165\u9580\u3011\u5909\u6570\u306e\u4ee3\u5165\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3068\u3053\u308d\u3067\u5909\u6570\u306b\u306f\u578b\u3068\u3044\u3046\u6982\u5ff5\u304c\u3042\u308a\u307e\u3059\u3002\u3067\u3001\u3042...<br><a class=\"no_icon\" href=\"https:\/\/python-introduction.com\/?p=447\">\u3010Python\u5165\u9580\u3011\u5909\u6570\u306e\u578b\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a> - python\u5165\u9580\u30c9\u30c3\u30c8\u30b3\u30e0<\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u305d\u308c\u3067\u306f\u4f8b\u984c8\u3092\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c8\r\nc = 1\r\nprint(type(c))<\/pre>\n<p>\u578b\u3092\u8abf\u3079\u308b\u3068\u304d\u306b\u306ftype\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">c = 1<\/pre>\n<p>\u3067\u6574\u6570\u306e1\u3092c\u306b\u4ee3\u5165\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u6574\u6570\u306fint\u578b\u3068\u3044\u3044\u307e\u3059\u3002<br \/>\n\u306a\u306e\u3067\u4f8b\u984c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u300eint\uff08\u578b\uff09\u300f\u3068<br \/>\n\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/intgata808.jpg\" alt=\"int\u578b\" width=\"205\" height=\"97\" class=\"alignnone size-full wp-image-531\" \/><\/p>\n<p>\u3067\u306f\u3053\u306e\u6574\u6570\u306e1\u3001\u8a00\u3044\u65b9\u3092\u5909\u3048\u308b\u3068<br \/>\nint\u578b\u306e1\u3092\u6587\u5b57\u5217\u306b\u5909\u63db\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u6587\u5b57\u5217\u306e\u3053\u3068\u3092str\u578b\u3068\u3044\u3044\u307e\u3059\u3002<br \/>\n\u306a\u306e\u3067int\u578b\u3092str\u578b\u306b\u578b\u5909\u63db\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4f8b\u984c9\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c9 \r\nc = str(1)\r\nprint(type(c))<\/pre>\n<p>int\u578b\u306e1\u3092str\u578b\u306b\u5909\u63db\u3059\u308b\u306b\u306f<br \/>\n\u300estr(1)\u300f\u3068\u3059\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/strgata808.jpg\" alt=\"str\u578b\" width=\"159\" height=\"95\" class=\"alignnone size-full wp-image-532\" \/><\/p>\n<p>\u3068int\u578b\u304cstr\u578b\u306b\u578b\u5909\u63db\u3055\u308c\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<p>\u6b21\u306b\u5c0f\u6570\u304c\u5165\u3063\u3066\u3044\u308b\u6570\u5b57\u306ffloat\u578b\u3068\u3044\u3044\u307e\u3059\u3002<br \/>\nfloat\u578b\u3082str\u578b\u306b\u578b\u5909\u63db\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u306f\u666e\u901a\u306b\u5c0f\u6570\u306e\u578b\u3092type\u3067\u8abf\u3079\u3066\u307f\u307e\u3059\u306d\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c10\r\nc = 5.698\r\nprint(type(c))<\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/floatgata808.jpg\" alt=\"float\u578b\" width=\"181\" height=\"106\" class=\"alignnone size-full wp-image-533\" \/><\/p>\n<p>float\u578b\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<p>\u3053\u306efloat\u578b\u3092str\u578b\uff08\u6587\u5b57\u5217\uff09\u306b<br \/>\n\u578b\u5909\u63db\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c11\r\nc = str(5.698)\r\nprint(type(c))<\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/floatkataej808.jpg\" alt=\"float\u578b\" width=\"177\" height=\"97\" class=\"alignnone size-full wp-image-534\" \/><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067str\u30675.698\u3092\uff08\uff09\u3067\u304f\u304f\u308c\u3070<br \/>\nstr\u578b\u306b\u578b\u5909\u63db\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u3067\u89e3\u8aac\u3092\u7d42\u308f\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u3053\u306e\u8a18\u4e8b\u3067\u306fformat\u95a2\u6570\u3067\u5b9f\u73fe\u3067\u304d\u308b\u4fbf\u5229\u306a\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066 \u89e3\u8aac\u3057\u307e\u3059\u3002 \u305f\u3068\u3048\u3070\u3001format\u95a2\u6570\u3092\u4f7f\u3048\u3070 \u3042\u306a\u305f\u306e\u601d\u3044\u901a\u308a\u306e\u5834\u6240\u306b \u6587\u5b57\u5217\u3092\u4ee3\u5165\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u305d\u308c\u3067\u306f\u672c\u984c\u306b\u5165\u3063\u3066\u3044\u304d\u307e\u3059\u3002 \u76ee\u6b21 [&hellip;]","protected":false},"author":1,"featured_media":512,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,39],"tags":[40,3],"_links":{"self":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/511"}],"collection":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=511"}],"version-history":[{"count":13,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/511\/revisions"}],"predecessor-version":[{"id":535,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/511\/revisions\/535"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/media\/512"}],"wp:attachment":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}