{"id":1138,"date":"2018-09-03T00:57:20","date_gmt":"2018-09-02T15:57:20","guid":{"rendered":"https:\/\/python-introduction.com\/?p=1138"},"modified":"2018-09-02T18:50:30","modified_gmt":"2018-09-02T09:50:30","slug":"%e3%80%90python%e5%85%a5%e9%96%80%e3%80%91input%e9%96%a2%e6%95%b0%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6%e4%be%8b%e9%a1%8c%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/python-introduction.com\/?p=1138","title":{"rendered":"\u3010Python\u5165\u9580\u3011input\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u4f8b\u984c\u3092\u4f7f\u3063\u3066\u89e3\u8aac"},"content":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u3067\u306finput\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066<br \/>\n\u4f8b\u984c\u3092\u6319\u3052\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>input\u95a2\u6570\u306b\u3064\u3044\u3066\u52c9\u5f37\u3059\u308b\u524d\u63d0\u3068\u3057\u3066<br \/>\nwhile\u6587\u3092\u6271\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u3059\u306e\u3067\u3001\u3082\u3057while\u6587\u3092\u5b66\u3093\u3067\u3044\u306a\u3044\u65b9\u306f<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=783\" target=\"blank\">\u3010Python\u3011while\u30eb\u30fc\u30d7\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a><\/p>\n<p>\u305d\u308c\u3067\u306f\u672c\u984c\u306b\u5165\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#Pythoninput\"><span class=\"toc_number toc_depth_1\">1<\/span> \u3010Python\u5165\u9580\u3011input\u95a2\u6570\u306e\u4f7f\u3044\u65b9:\u6587\u5b57\u5217<\/a><\/li><li><a href=\"#Pythoninput-2\"><span class=\"toc_number toc_depth_1\">2<\/span> \u3010Python\u5165\u9580\u3011input\u95a2\u6570\u306e\u4f7f\u3044\u65b9:\u6570\u5b57<\/a><\/li><li><a href=\"#Pythoninput-3\"><span class=\"toc_number toc_depth_1\">3<\/span> \u3010Python\u5165\u9580\u3011input\u95a2\u6570\u306e\u4f7f\u3044\u65b9:\u307e\u3068\u3081<\/a><\/li><\/ul><\/div>\n<h2><span id=\"Pythoninput\">\u3010Python\u5165\u9580\u3011input\u95a2\u6570\u306e\u4f7f\u3044\u65b9:\u6587\u5b57\u5217<\/span><\/h2>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pasokonikarudanse828.jpg\" alt=\"input\u95a2\u6570\u306e\u4f7f\u3044\u65b9\" width=\"620\" height=\"414\" class=\"alignnone size-full wp-image-1105\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pasokonikarudanse828.jpg 620w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/08\/pasokonikarudanse828-300x200.jpg 300w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>input\u95a2\u6570\u3092\u4f7f\u3063\u305f\u4f8b\u984c\u3092\u307e\u305a\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c1\r\n\r\nwhile True:\r\n    x = input('\u4f55\u304b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff1b')\r\n    if x =='\u3053\u3093\u306b\u3061\u306f':\r\n        break\r\n    print('\u3084\u308a\u76f4\u3057\uff01')\r\n        <\/pre>\n<p>input\u95a2\u6570\u306fwhile\u6587\u3068\u304b\u3089\u3081\u3066\u4f7f\u308f\u308c\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">while True:<\/pre>\n<p>\u6b21\u306b<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">    x = input('\u4f55\u304b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff1b')<\/pre>\n<p>\u5909\u6570x\u306binput\u95a2\u6570\u3092\u547c\u3073\u51fa\u3057\u3066\u300e\u4f55\u304b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff1b\u300f\u3068\u3044\u3046\u6587\u5b57\u3092<br \/>\n\u8868\u793a\u3055\u305b\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">   if x =='\u3053\u3093\u306b\u3061\u306f':\r\n        break<\/pre>\n<p>\u3082\u3057\u300e\u3053\u3093\u306b\u3061\u306f\u300f\u3068\u5165\u529b\u3057\u305f\u3089\u3001<br \/>\nbreak\u306b\u3088\u3063\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u3053\u3053\u3067\u7d42\u4e86\u3057\u307e\u3059\u3002<\/p>\n<p>\u3067\u3082\u3001\u300e\u3053\u3093\u306b\u3061\u306f\u300f\u4ee5\u5916\u304c\u5165\u529b\u3055\u308c\u305f\u3089<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">    print('\u3084\u308a\u76f4\u3057\uff01')<\/pre>\n<p>\u300e\u3084\u308a\u76f4\u3057\uff01\u300f\u3068\u8868\u793a\u3055\u308c\u3001<br \/>\n\u307e\u305f<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">    x = input('\u4f55\u304b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff1b')<\/pre>\n<p>\u306b\u623b\u308a\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u884c\u3059\u308b\u3068\u4e0b\u8a18\u753b\u50cf\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/inputkasnu902.jpg\" alt=\"input\u95a2\u6570\" width=\"544\" height=\"204\" class=\"alignnone size-full wp-image-1141\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/inputkasnu902.jpg 544w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/inputkasnu902-300x113.jpg 300w\" sizes=\"(max-width: 544px) 100vw, 544px\" \/><\/p>\n<p>\u4e0a\u8a18\u753b\u50cf\u306e\u3088\u3046\u306b\u300e\u4f55\u304b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u300f<br \/>\n\u3068\u8868\u793a\u3055\u308c\u3001\u30dc\u30c3\u30af\u30b9\u304c\u73fe\u308c\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u3001\u300e\u3053\u3093\u306b\u3061\u306f\u300f\u3068\u5165\u529b\u3059\u308b\u3068<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/inputshuryou9o2.jpg\" alt=\"input\" width=\"545\" height=\"159\" class=\"alignnone size-full wp-image-1143\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/inputshuryou9o2.jpg 545w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/inputshuryou9o2-300x88.jpg 300w\" sizes=\"(max-width: 545px) 100vw, 545px\" \/><\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">   if x =='\u3053\u3093\u306b\u3061\u306f':\r\n        break<\/pre>\n<p>break\u304c\u9069\u7528\u3055\u308c\u3001<br \/>\n\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u7d42\u4e86\u3057\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u3001\u300e\u3053\u3093\u306b\u3061\u306f\u300f\u4ee5\u5916\u306e\u6587\u5b57\u304c\u5165\u529b\u3055\u308c\u305f\u3089<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/inputshuryoumade902.jpg\" alt=\"input\u95a2\u6570\" width=\"538\" height=\"208\" class=\"alignnone size-full wp-image-1144\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/inputshuryoumade902.jpg 538w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/inputshuryoumade902-300x116.jpg 300w\" sizes=\"(max-width: 538px) 100vw, 538px\" \/><\/p>\n<p>\u300e\u3053\u3093\u306b\u3061\u306f\u300f\u3068\u5165\u529b\u3055\u308c\u308b\u307e\u3067<br \/>\n\u3072\u3089\u3059\u3089\u300e\u3084\u308a\u76f4\u3057\uff01\u300f\u300e\u4f55\u304b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u300f<br \/>\n\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2><span id=\"Pythoninput-2\">\u3010Python\u5165\u9580\u3011input\u95a2\u6570\u306e\u4f7f\u3044\u65b9:\u6570\u5b57<\/span><\/h2>\n<p>\u4f8b\u984c1\u306f\u300e\u3053\u3093\u306b\u3061\u306f\u300f\u306a\u3069\u306e\u6587\u5b57\u5217\u3092\u6271\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u6570\u5b57\uff08int\u578b\u3084float\u578b\uff09\u306f\u3069\u3046\u3059\u308c\u3070\u3088\u3044\u3067\u3057\u3087\u3046\uff1f<\/p>\n<p>\u300cint\u578b\u3068\u304bfloat\u578b\u3068\u304b\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u300d<br \/>\n\u3068\u3044\u3046\u5834\u5408\u306b\u306f\u3001\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<br \/>\n\u21d2<a href=\"https:\/\/python-introduction.com\/?p=447\" target=\"blank\">\u3010Python\u5165\u9580\u3011\u5909\u6570\u306e\u578b\u306b\u3064\u3044\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a><\/p>\n<p>\u3067\u306f\u4f8b\u984c2\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#\u4f8b\u984c2\r\n\r\nwhile True:\r\n    x = input('\u4f55\u304b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff1b')\r\n    kazu = int(x)\r\n    if kazu == 99:\r\n        break\r\n    print('\u3084\u308a\u76f4\u3057\uff01')<\/pre>\n<p>\u4f8b\u984c3\u3067\u3059\u304c<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">while True:\r\n    x = input('\u4f55\u304b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff1b')\r\n    kazu = int(x)<\/pre>\n<p>\u3067\u3059\u304c\u3001\u5165\u529b\u3055\u308c\u305f\u6587\u5b57\u306f\u6587\u5b57\u5217\u3068\u3044\u3046\u8a8d\u8b58\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u306a\u306e\u3067\u3001int\u578b\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">kazu = int(x)<\/pre>\n<p>\u3067\u3001\u5909\u6570x\u3092int\u578b\uff08\u6574\u6570\uff09\u306b\u306a\u308a\u3001<br \/>\n\u305d\u3057\u3066\u5909\u6570kazu\u306b\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">   if kazu == 99:<\/pre>\n<p>99\u3068\u5165\u529b\u3055\u308c\u308b\u307e\u3067\u300e\u3084\u308a\u76f4\u3057\uff01\u300f\u304c\u7d9a\u304d\u307e\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\/09\/ru-pusan902.jpg\" alt=\"input\u95a2\u6570\" width=\"352\" height=\"219\" class=\"alignnone size-full wp-image-1147\" srcset=\"https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/ru-pusan902.jpg 352w, https:\/\/python-introduction.com\/wp-content\/uploads\/2018\/09\/ru-pusan902-300x187.jpg 300w\" sizes=\"(max-width: 352px) 100vw, 352px\" \/><\/p>\n<p>\u3068\u8a00\u3063\u305f\u611f\u3058\u3067\u300199\u3068\u5165\u529b\u3055\u308c\u308b\u307e\u3067<br \/>\n\u3072\u305f\u3059\u3089\u300e\u3084\u308a\u76f4\u3057!\u300f\u304c\u7d9a\u304d\u307e\u3059\u3002<\/p>\n<h2><span id=\"Pythoninput-3\">\u3010Python\u5165\u9580\u3011input\u95a2\u6570\u306e\u4f7f\u3044\u65b9:\u307e\u3068\u3081<\/span><\/h2>\n<p>\u4f8b\u984c1\u3084\u4f8b\u984c2\u306e\u3088\u3046\u306b\u30b3\u30f3\u30bd\u30fc\u30eb\u4e0a\u304b\u3089\u4f55\u304b\u5165\u529b\u3057\u3066<br \/>\n\u3082\u3057\u5165\u529b\u3055\u308c\u305f\u5024\u304c\u601d\u3044\u901a\u308a\u3067\u306a\u3051\u308c\u3070<br \/>\n\u30eb\u30fc\u30d7\u306b\u623b\u308a\u3001\u601d\u3044\u901a\u308a\u306e\u5024\u304c\u5165\u529b\u3055\u308c\u308b\u307e\u3067<br \/>\n\u7d9a\u3051\u308b\u306b\u306f\u3001while\u30eb\u30fc\u30d7\u3068input\u95a2\u6570\u3092\u4f7f\u3046\u306e\u304c\u6700\u9069\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u3067input\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u306e\u89e3\u8aac\u3092\u7d42\u308f\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u3053\u306e\u8a18\u4e8b\u3067\u306finput\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066 \u4f8b\u984c\u3092\u6319\u3052\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002 input\u95a2\u6570\u306b\u3064\u3044\u3066\u52c9\u5f37\u3059\u308b\u524d\u63d0\u3068\u3057\u3066 while\u6587\u3092\u6271\u3044\u307e\u3059\u3002 \u3067\u3059\u306e\u3067\u3001\u3082\u3057while\u6587\u3092\u5b66\u3093\u3067\u3044\u306a\u3044\u65b9\u306f \u5148\u306b\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092 [&hellip;]","protected":false},"author":1,"featured_media":1139,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[113,16],"tags":[114,115,3,13],"_links":{"self":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1138"}],"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=1138"}],"version-history":[{"count":5,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1138\/revisions"}],"predecessor-version":[{"id":1148,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/posts\/1138\/revisions\/1148"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=\/wp\/v2\/media\/1139"}],"wp:attachment":[{"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-introduction.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}