{"id":2379,"date":"2024-04-25T15:00:04","date_gmt":"2024-04-25T06:00:04","guid":{"rendered":"https:\/\/www.miraiserver.ne.jp\/column\/?p=2379"},"modified":"2025-08-18T16:42:40","modified_gmt":"2025-08-18T07:42:40","slug":"about_python-coding-method","status":"publish","type":"post","link":"https:\/\/www.miraiserver.ne.jp\/column\/about_python-coding-method\/","title":{"rendered":"5\u5206\u3067\u308f\u304b\u308b! Python\u306e\u57fa\u672c\u69cb\u6587\u3068\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9\u3092\u89e3\u8aac\uff01"},"content":{"rendered":"<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-4454 size-full\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u5dee\u3057\u66ff\u3048\u7528-6\u6e08.webp\" alt=\"\" width=\"900\" height=\"506\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u5dee\u3057\u66ff\u3048\u7528-6\u6e08.webp 900w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u5dee\u3057\u66ff\u3048\u7528-6\u6e08-300x169.webp 300w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u5dee\u3057\u66ff\u3048\u7528-6\u6e08-640x360.webp 640w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u5dee\u3057\u66ff\u3048\u7528-6\u6e08-768x432.webp 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p>\n<p><strong>Python\u306e\u4eba\u6c17\u306e\u7406\u7531\u306e\u4e00\u3064<\/strong>\u306f\u3001\u305d\u306e<span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\"><strong>\u30b7\u30f3\u30d7\u30eb\u3055<\/strong>\u3068<strong>\u8aad\u307f\u3084\u3059\u3055<\/strong>\u306b\u3042\u308a\u307e\u3059\u3002<\/span><\/p>\n<p>\u521d\u5fc3\u8005\u3067\u3082\u66f8\u304d\u65b9\u306e\u30eb\u30fc\u30eb\u304c\u7406\u89e3\u3057\u3084\u3059\u3044\u3053\u3068\u304b\u3089\u5b66\u7fd2\u3057\u3084\u3059\u3044\u8a00\u8a9e\u3068\u8a00\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001<span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">Python\u306e\u57fa\u672c\u69cb\u6587\u3084\u5236\u5fa1\u6587\u306b\u3064\u3044\u3066\u3001\u521d\u5fc3\u8005\u306b\u3082\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/span><\/p>\n<div class=\"cardlink\">\r\n    <a class=\"image\" href=\"https:\/\/www.miraiserver.ne.jp\/column\/about_python\/\">\r\n     <img src=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u5dee\u3057\u66ff\u3048\u7528-21\u6e08.webp\">\r\n    <\/a>\r\n    <div class=\"content\">\r\n     <div class=\"title_area\">\r\n      <p class=\"date\">2024.04.11<\/p>\r\n      <h4 class=\"title\">\r\n       <a href=\"https:\/\/www.miraiserver.ne.jp\/column\/about_python\/\">Python\u3068\u306f\u3002\u7279\u5fb4\u3001\u30e1\u30ea\u30c3\u30c8\u3001\u5b9f\u969b\u306e\u6d3b\u7528\u4f8b\u3092\u89e3\u8aac\uff01<\/a>\r\n      <\/h4>\r\n     <\/div>\r\n     <p class=\"desc\"><span>\r\n\r\n\u300c\u4eca\u4eba\u6c17\u306e\u3042\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306fPython\u300d\r\n\r\n\u305d\u3093\u306a\u30d5\u30ec\u30fc\u30ba\u3092\u805e\u3044\u305f\u3053\u3068\u304c\u3042\u308b\u4eba\u3082\u591a\u3044\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f\r\n\r\nPyt...<\/span><\/p>\r\n    <\/div>\r\n   <\/div>\n\n<p class=\"well2\" style=\"text-align: center;\"><strong><span style=\"color: #008000;\">VPS\u306a\u3089\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc<\/span><strong style=\"font-size: 16px;\"><span style=\"color: #339966;\"><br \/>\n<\/span><\/strong><span style=\"color: #ff0000;\">\uff3c2\u9031\u9593\u7121\u6599\u30fb\u5168\u30d7\u30e9\u30f3SSD\u642d\u8f09\uff0f<\/span><br \/>\n<a class=\"btn_10\" href=\"https:\/\/www.miraiserver.ne.jp\/vps?utm_source=article-frame-btn&amp;utm_medium=referral&amp;utm_campaign=mirai-vps\" target=\"_blank\" rel=\"noopener noreferrer\">\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u3092\u7121\u6599\u3067\u8a66\u3059<\/a><\/strong><\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#Python\"><span class=\"toc_number toc_depth_1\">1<\/span> Python\u306e\u57fa\u672c\u69cb\u6587<\/a><ul><li><a href=\"#i\"><span class=\"toc_number toc_depth_2\">1.1<\/span> \u8a18\u8ff0\u306e\u30eb\u30fc\u30eb<\/a><\/li><li><a href=\"#i-2\"><span class=\"toc_number toc_depth_2\">1.2<\/span> \u30b3\u30e1\u30f3\u30c8\u306e\u66f8\u304d\u65b9<\/a><\/li><li><a href=\"#i-3\"><span class=\"toc_number toc_depth_2\">1.3<\/span> \u95a2\u6570\u3068\u306f<\/a><\/li><li><a href=\"#i-4\"><span class=\"toc_number toc_depth_2\">1.4<\/span> \u5909\u6570\u3068\u306f<\/a><\/li><\/ul><\/li><li><a href=\"#Python-2\"><span class=\"toc_number toc_depth_1\">2<\/span> Python\u306e\u5236\u5fa1\u6587<\/a><ul><li><a href=\"#if\"><span class=\"toc_number toc_depth_2\">2.1<\/span> \u6761\u4ef6\u5206\u5c90(if\u6587)<\/a><\/li><li><a href=\"#for\"><span class=\"toc_number toc_depth_2\">2.2<\/span> \u7e70\u308a\u8fd4\u3057\u51e6\u7406(for\u6587)<\/a><\/li><li><a href=\"#while\"><span class=\"toc_number toc_depth_2\">2.3<\/span> \u6761\u4ef6\u304c\u6b63\u3057\u3044\u6642\u306b\u7e70\u308a\u8fd4\u3059\u51e6\u7406\uff08while\u6587\uff09<\/a><\/li><li><a href=\"#break_continue_pass\"><span class=\"toc_number toc_depth_2\">2.4<\/span> \u6761\u4ef6\u5206\u5c90\u5185\u3001\u30eb\u30fc\u30d7\u5185\u306e\u51e6\u7406\uff08break, continue, pass\uff09<\/a><\/li><\/ul><\/li><li><a href=\"#i-5\"><span class=\"toc_number toc_depth_1\">3<\/span> \u307e\u3068\u3081<\/a><\/li><li><a href=\"#UnixLinuxVPS\"><span class=\"toc_number toc_depth_1\">4<\/span> Unix\u3084Linux\u306eVPS\u306a\u3089\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc<\/a><\/li><\/ul><\/div>\n<h2 class=\"styled_h2\"><span id=\"Python\">Python\u306e\u57fa\u672c\u69cb\u6587<\/span><\/h2>\n<p>\u307e\u305a\u306f\u57fa\u672c\u3068\u306a\u308b\u69cb\u6587\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<h3 class=\"styled_h3\"><span id=\"i\">\u8a18\u8ff0\u306e\u30eb\u30fc\u30eb<\/span><\/h3>\n<p>Python\u306f\u3001\u30b3\u30fc\u30c9\u304c\u4e00\u884c\u305a\u3064\u72ec\u7acb\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Python\u3067\u306f\u3001<span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">C\u3084HTML\u306a\u3069\u306e\u3088\u3046\u306b\u884c\u306e\u7d42\u308f\u308a\u306b\u30bb\u30df\u30b3\u30ed\u30f3\uff08;\uff09\u3092\u52a0\u3048\u308b\u3053\u3068\u306f\u5fc5\u9808\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/span><\/p>\n<p>\u30b3\u30fc\u30c9\u304c\u8aad\u307f\u3084\u3059\u304f\u306a\u308b\u3088\u3046\u3001\u6bb5\u843d\u5206\u3051\u3092\u3059\u308b\u305f\u3081\u306b\u7a7a\u884c\u3092\u4f7f\u7528\u3057\u3066\u3001\u5404\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u660e\u78ba\u306b\u533a\u5207\u308b\u3068\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001<span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u8907\u6570\u884c\u306b\u307e\u305f\u304c\u308b\u3088\u3046\u306a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u304c\u3067\u304d\u306a\u3044\u3068\u8aad\u307f\u306b\u304f\u3044\u3082\u306e\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u8907\u6570\u884c\u3067\u306e\u8868\u73fe\u3082\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p>Python\u3067\u306f\u3001<span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u30a4\u30f3\u30c7\u30f3\u30c8\uff08\u5b57\u4e0b\u3052\uff09\u306b\u3088\u3063\u3066\u30b3\u30fc\u30c9\u306e\u30d6\u30ed\u30c3\u30af\u3092\u8868\u73fe\u3057\u307e\u3059\u3002<\/span><\/p>\n<p>\u30a4\u30f3\u30c7\u30f3\u30c8\u306b\u3088\u3063\u3066\u8aad\u307f\u3084\u3059\u304f\u3059\u308b\u52b9\u679c\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3 class=\"styled_h3\"><span id=\"i-2\">\u30b3\u30e1\u30f3\u30c8\u306e\u66f8\u304d\u65b9<\/span><\/h3>\n<p><span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">\u30b3\u30e1\u30f3\u30c8\u306f\u4ed6\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3068\u540c\u69d8\u306b#\u8a18\u53f7\u3092\u4f7f\u3044\u307e\u3059\u3002<\/span><\/p>\n<p>#\u304b\u3089\u6587\u672b\u307e\u3067\u306f\u30b3\u30e1\u30f3\u30c8\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u6642\u306b\u7121\u8996\u3055\u308c\u307e\u3059\u3002<\/p>\n<p class=\"well2\"><strong># \u3053\u306e\u884c\u306f\u30b3\u30e1\u30f3\u30c8\u3067\u3059<\/strong><\/p>\n<p><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u4fee\u6b63\u3092\u3059\u308b\u969b\u306a\u3069\u4e00\u6642\u7684\u306b\u7279\u5b9a\u306e\u884c\u3092\u4e00\u6642\u7684\u306b\u52d5\u304b\u306a\u304f\u3057\u305f\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/span><\/p>\n<p>\u305d\u306e\u6642\u306b\u3082\u30b3\u30e1\u30f3\u30c8\u304c\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n<p class=\"well2\"><strong># print(&#8220;\u3053\u308c\u306f\u8868\u793a\u3055\u308c\u307e\u305b\u3093&#8221;)<\/strong><\/p>\n<h3 class=\"styled_h3\"><span id=\"i-3\">\u95a2\u6570\u3068\u306f<\/span><\/h3>\n<p>\u95a2\u6570\u306f\u3001<span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u7e70\u308a\u8fd4\u3057\u4f7f\u7528\u3055\u308c\u308b\u7279\u5b9a\u306e\u51e6\u7406\u3092\u4e00\u3064\u306e\u30b3\u30fc\u30c9\u30d6\u30ed\u30c3\u30af\u306b\u307e\u3068\u3081\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u4f55\u5ea6\u3067\u3082\u547c\u3073\u51fa\u305b\u308b\u69cb\u9020<\/span>\u3067\u3059\u3002<\/p>\n<p>\u95a2\u6570\u306f<span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\"><strong>\u300cdef\u300d<\/strong>\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u7528\u3044\u3066\u5b9a\u7fa9\u3057\u3001\u95a2\u6570\u540d\u3068\u62ec\u5f27\u5185\u306b\u5f15\u6570\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/span><\/p>\n<p>\u95a2\u6570\u672c\u4f53\u3067\u306f\u3001\u5b9f\u884c\u3057\u305f\u3044\u5177\u4f53\u7684\u306a\u51e6\u7406\u3092\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u7528\u3044\u3066\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<p><span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">\u6b21\u306b<strong>\u300creturn\u300d<\/strong>\u306f\u95a2\u6570\u304b\u3089\u5024\u3092\u8fd4\u3059\u969b\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/span><\/p>\n<p>\u4f8b\u3048\u3070\u3001\u6b21\u306e\u30b3\u30fc\u30c9\u306f\u6574\u6570\u306e\u8db3\u3057\u7b97\u3092\u884c\u3046\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u3001\u305d\u308c\u3092\u7528\u3044\u3066\u8907\u6570\u306e\u30ea\u30b9\u30c8\u306e\u5408\u8a08\u3092\u8a08\u7b97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p class=\"well2\"><strong># \u4e0e\u3048\u3089\u308c\u305f\u5024\u3092\u5408\u8a08\u3059\u308b\u95a2\u6570<\/strong><br \/>\n<strong>def sum(numbers):<\/strong><br \/>\n<strong>total = 0<\/strong><br \/>\n<strong>for i in numbers:<\/strong><br \/>\n<strong>total = total + i<\/strong><br \/>\n<strong>return total<\/strong><br \/>\n<strong>a = [1, 2, 3, 4, 5]<\/strong><br \/>\n<strong>b = [1, 10, 100, 1000]<\/strong><br \/>\n<strong>c = [5, 10, 15, 20, 25]<\/strong><br \/>\n<strong>d = sum(a)<\/strong><br \/>\n<strong>e = sum(b)<\/strong><br \/>\n<strong>f = sum(c)<\/strong><br \/>\n<strong>print(d, e, f)<\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-4442\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf1-10.webp\" alt=\"\" width=\"602\" height=\"213\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf1-10.webp 602w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf1-10-300x106.webp 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-4443\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf2-10.webp\" alt=\"\" width=\"600\" height=\"133\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf2-10.webp 499w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf2-10-300x67.webp 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001sum \u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u3066\u8907\u6570\u306e\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u3092\u5408\u8a08\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3 class=\"styled_h3\"><span id=\"i-4\">\u5909\u6570\u3068\u306f<\/span><\/h3>\n<p>\u5909\u6570\u3068\u306f\u3001<strong><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e2d\u3067\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3057\u3066\u304a\u304f\u305f\u3081\u306e\u7bb1\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002<\/span><\/strong><\/p>\n<p>\u5909\u6570\u306b\u306f\u540d\u524d\u304c\u4ed8\u3051\u3089\u308c\u3066\u304a\u308a\u3001\u305d\u306e\u540d\u524d\u3092\u4f7f\u3063\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u5185\u3067\u4f55\u5ea6\u3067\u3082\u305d\u306e\u30c7\u30fc\u30bf\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001<span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">a = 1\u3068\u3044\u3046\u30b3\u30fc\u30c9\u3067\u306f\u3001\u5909\u6570a\u306b1\u3068\u3044\u3046\u5024\u304c\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002<\/span><\/p>\n<p>\u3053\u306e\u72b6\u614b\u3067\u3001<span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">a = a + 1\u3068\u3044\u3046\u64cd\u4f5c\u3092\u884c\u3046\u3068\u3001a\u306e\u5024\u306f2\u306b\u66f4\u65b0\u3055\u308c\u307e\u3059\u3002<\/span><\/p>\n<p><strong>\u5909\u6570\u306f\u3001<span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u8a08\u7b97\u7d50\u679c\u3092\u4e00\u6642\u7684\u306b\u4fdd\u5b58\u3057\u305f\u308a\u3001\u5f8c\u306e\u51e6\u7406\u3067\u518d\u5229\u7528\u3057\u305f\u308a\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/span><\/strong><\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u5909\u6570a\u306b100\u3068\u3044\u3046\u5024\u3092\u4ee3\u5165\u3057\u3001\u5909\u6570b\u306ba\u306e\u5024\u30922\u500d\u3057\u305f\u5024\u3092\u4ee3\u5165\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p class=\"well2\"><strong>a = 100<\/strong><br \/>\n<strong>b = a*2<\/strong><br \/>\n<strong>print(a)<\/strong><br \/>\n<strong>print(b)<\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-4445\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf4-8.webp\" alt=\"\" width=\"600\" height=\"201\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf4-8.webp 379w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf4-8-300x101.webp 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-4444\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf3-8.webp\" alt=\"\" width=\"600\" height=\"70\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf3-8.webp 402w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf3-8-300x35.webp 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<p style=\"text-align: center;\"><span style=\"color: #008080;\"><strong>\uff3c 2\u9031\u9593\u7121\u6599\u3067\u304a\u8a66\u3057\u3067\u304d\u307e\u3059\uff01 \uff0f<\/strong><\/span><br \/>\n<a class=\"btn_10\" href=\"https:\/\/www.miraiserver.ne.jp\/vps?utm_source=btn-vps&amp;utm_medium=referral&amp;utm_campaign=mirai-vps\" target=\"_blank\" rel=\"noopener noreferrer\">VPS\u3092\u4f7f\u3063\u3066\u307f\u308b<\/a><\/p>\n<h2 class=\"styled_h2\"><span id=\"Python-2\">Python\u306e\u5236\u5fa1\u6587<\/span><\/h2>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-thumbnail wp-image-4453\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf15-2-540x360.webp\" alt=\"\" width=\"540\" height=\"360\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf15-2-540x360.webp 540w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf15-2-300x200.webp 300w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf15-2.webp 602w\" sizes=\"(max-width: 540px) 100vw, 540px\" \/><\/p>\n<p>\u6b21\u306b<span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">Python\u3067\u306e\u52d5\u4f5c\u3092\u6c7a\u3081\u308b\u5236\u5fa1\u6587\u306b\u3064\u3044\u3066\u89e3\u8aac<\/span>\u3057\u307e\u3059\u3002<\/p>\n<h3 class=\"styled_h3\"><span id=\"if\">\u6761\u4ef6\u5206\u5c90(if\u6587)<\/span><\/h3>\n<p><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">Python\u306eif\u6587\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u3001\u7279\u5b9a\u306e\u6761\u4ef6\u4e0b\u3067\u306e\u307f\u5b9f\u884c\u3055\u308c\u308b\u30b3\u30fc\u30c9\u30d6\u30ed\u30c3\u30af\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><strong>\u57fa\u672c\u69cb\u6587<\/strong><\/p>\n<p class=\"well2\"><strong>if \u6761\u4ef6\u5f0f:<\/strong><br \/>\n<strong>\u51e6\u7406<\/strong><br \/>\n<strong>\u6761\u4ef6\u5f0f\u304cTrue\uff08\u771f\uff09\u306e\u5834\u5408\u306b\u306e\u307f\u3001\u30a4\u30f3\u30c7\u30f3\u30c8\u3055\u308c\u305f\u30d6\u30ed\u30c3\u30af\u5185\u306e\u51e6\u7406\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/strong><\/p>\n<p>\u4f8b\uff09<\/p>\n<p class=\"well2\"><strong>a=1<\/strong><br \/>\n<strong>if a==1:<\/strong><br \/>\n<strong>flag = True<\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-4446\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf5-5.webp\" alt=\"\" width=\"430\" height=\"172\" \/><\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001a\u304c1\u3067\u3042\u308b\u5834\u5408\u306b\u3001flag\u3092True\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u6761\u4ef6\u5f0f\u306b\u306f\u4ee5\u4e0b\u306e\u6bd4\u8f03\u6f14\u7b97\u5b50\u304c\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<p class=\"well2\"><strong>==\uff1a\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7b49\u3057\u3044<\/strong><br \/>\n<strong>!=\uff1a\u5de6\u8fba\u3068\u53f3\u8fba\u304c\u7b49\u3057\u304f\u306a\u3044<\/strong><br \/>\n<strong>&lt;\uff1a\u5de6\u8fba\u304c\u53f3\u8fba\u3088\u308a\u5c0f\u3055\u3044<\/strong><br \/>\n<strong>&lt;=\uff1a\u5de6\u8fba\u304c\u53f3\u8fba\u4ee5\u4e0b<\/strong><br \/>\n<strong>&gt;\uff1a\u5de6\u8fba\u304c\u53f3\u8fba\u3088\u308a\u5927\u304d\u3044<\/strong><br \/>\n<strong>&gt;=\uff1a\u5de6\u8fba\u304c\u53f3\u8fba\u4ee5\u4e0a<\/strong><\/p>\n<p>\u6bd4\u8f03\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3057\u3066\u3001\u69d8\u3005\u306a\u6761\u4ef6\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><strong>\u8907\u6570\u306e\u6761\u4ef6<\/strong><\/p>\n<p><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">if\u6587\u3067\u306f\u3001elif\uff08else if\u306e\u7565\uff09\u3068else\u3092\u4f7f\u7528\u3057\u3066\u3001\u8907\u6570\u306e\u6761\u4ef6\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/span><\/p>\n<p class=\"well2\"><strong>x = 10<\/strong><br \/>\n<strong>if x &gt; 10:<\/strong><br \/>\n<strong>print(&#8220;x\u306f10\u3088\u308a\u5927\u304d\u3044&#8221;)<\/strong><br \/>\n<strong>elif x == 10:<\/strong><br \/>\n<strong>print(&#8220;x\u306f10\u3067\u3059&#8221;)<\/strong><br \/>\n<strong>else:<\/strong><br \/>\n<strong>print(&#8220;x\u306f10\u3088\u308a\u5c0f\u3055\u3044&#8221;)<\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-4447\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf6-5.webp\" alt=\"\" width=\"430\" height=\"229\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf6-5.webp 302w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf6-5-300x160.webp 300w\" sizes=\"(max-width: 430px) 100vw, 430px\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-4439\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf7-5.webp\" alt=\"\" width=\"433\" height=\"79\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf7-5.webp 433w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf7-5-300x55.webp 300w\" sizes=\"(max-width: 433px) 100vw, 433px\" \/><\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001x\u304c10\u3088\u308a\u5927\u304d\u3044\u5834\u5408\u300110\u3067\u3042\u308b\u5834\u5408\u300110\u3088\u308a\u5c0f\u3055\u3044\u5834\u5408\u306e3\u3064\u306e\u30b7\u30ca\u30ea\u30aa\u306b\u5bfe\u3057\u3066\u7570\u306a\u308b\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<h3 class=\"styled_h3\"><span id=\"for\">\u7e70\u308a\u8fd4\u3057\u51e6\u7406(for\u6587)<\/span><\/h3>\n<p><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">Python\u3067\u306e\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u306f\u3001for\u6587\u3092\u7528\u3044\u3066\u7c21\u5358\u306b\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><strong>\u57fa\u672c\u69cb\u6587<\/strong><\/p>\n<p class=\"well2\"><strong>for \u5909\u6570 in \u30a4\u30c6\u30e9\u30d6\u30eb:<\/strong><br \/>\n<strong>\u51e6\u7406<\/strong><br \/>\n<strong>\u3053\u306e\u69cb\u9020\u306b\u304a\u3044\u3066\u3001\u5909\u6570\u306b\u306f\u30a4\u30c6\u30e9\u30d6\u30eb\u304b\u3089\u53d6\u308a\u51fa\u3057\u305f\u8981\u7d20\u304c\u9806\u306b\u4ee3\u5165\u3055\u308c\u3001\u305d\u306e\u5909\u6570\u3092\u4f7f\u7528\u3057\u3066\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002<\/strong><\/p>\n<p>\u4f8b\uff09<\/p>\n<p class=\"well2\"><strong>a = [2,4,6,8,10]<\/strong><br \/>\n<strong>for i in a:<\/strong><br \/>\n<strong>print(i)<\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-4440\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf8-5.webp\" alt=\"\" width=\"430\" height=\"157\" \/><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-4441\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf9-5.webp\" alt=\"\" width=\"430\" height=\"124\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf9-5.webp 336w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf9-5-300x87.webp 300w\" sizes=\"(max-width: 430px) 100vw, 430px\" \/><\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001\u30ea\u30b9\u30c8a\u306e\u5404\u8981\u7d20\u304c\u9806\u306bi\u306b\u4ee3\u5165\u3055\u308c\u3001print(i)\u306b\u3088\u3063\u3066\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3 class=\"styled_h3\"><span id=\"while\">\u6761\u4ef6\u304c\u6b63\u3057\u3044\u6642\u306b\u7e70\u308a\u8fd4\u3059\u51e6\u7406\uff08while\u6587\uff09<\/span><\/h3>\n<p><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">Python\u306ewhile\u6587\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u6307\u5b9a\u3057\u305f\u6761\u4ef6\u304c\u771f\uff08True\uff09\u3067\u3042\u308b\u9650\u308a\u3001\u7279\u5b9a\u306e\u30b3\u30fc\u30c9\u30d6\u30ed\u30c3\u30af\u304c\u7e70\u308a\u8fd4\u3057\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/span><\/p>\n<p>\u3053\u306e\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u306f\u3001<span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">\u6761\u4ef6\u304c\u507d\uff08False\uff09\u306b\u306a\u308b\u307e\u3067\u7d9a\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><strong>\u57fa\u672c\u69cb\u6587<\/strong><\/p>\n<p class=\"well2\"><strong>while \u6761\u4ef6\u5f0f:<\/strong><br \/>\n<strong>\u6761\u4ef6\u5f0f\u304c\u771f\u3067\u3042\u308b\u9593\u5b9f\u884c\u3055\u308c\u308b\u30b3\u30fc\u30c9<\/strong><\/p>\n<p>\u4f8b\uff09<\/p>\n<p class=\"well2\"><strong>num = 0<\/strong><br \/>\n<strong>while num &lt; 2:<\/strong><br \/>\n<strong>print(&#8220;num = &#8221; + str(num))<\/strong><br \/>\n<strong>num += 1 # num\u306e\u5024\u30921\u5897\u3084\u3059<\/strong><br \/>\n<strong>print(&#8220;End&#8221;)<\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-4448\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf10-5.webp\" alt=\"\" width=\"430\" height=\"160\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf10-5.webp 366w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf10-5-300x111.webp 300w\" sizes=\"(max-width: 430px) 100vw, 430px\" \/><\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001\u6b21\u306e\u3088\u3046\u306a\u51e6\u7406\u304c\u884c\u308f\u308c\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>\u5909\u6570num\u306b0\u3092\u4ee3\u5165\u3002<\/li>\n<li>while\u6587\u306e\u6761\u4ef6\u5f0f\u3092\u8a55\u4fa1\u3002\u5909\u6570num\u306f2\u3088\u308a\u5c0f\u3055\u3044\u306e\u3067\u6761\u4ef6\u5f0f\u306f\u771f\u3002<\/li>\n<li>\u5909\u6570num\u306e\u5024\u3092\u51fa\u529b\u3002<\/li>\n<li>num\u306e\u5024\u30921\u5897\u3084\u3059\u3002<\/li>\n<li>\u30d6\u30ed\u30c3\u30af\u306e\u6700\u5f8c\u307e\u3067\u9054\u3057\u305f\u306e\u3067\u518d\u5ea6while\u6587\u306e\u6761\u4ef6\u5f0f\u3092\u8a55\u4fa1\u3002<\/li>\n<li>\u6761\u4ef6\u304c\u507d\u306b\u306a\u308b\u307e\u3067\uff08num\u304c2\u4ee5\u4e0a\u306b\u306a\u308b\u307e\u3067\uff093\u304b\u30895\u306e\u51e6\u7406\u3092\u7e70\u308a\u8fd4\u3059\u3002<\/li>\n<li>\u6761\u4ef6\u304c\u507d\u306b\u306a\u3063\u305f\u306e\u3067while\u6587\u3092\u629c\u3051\u3001print(&#8220;End&#8221;)\u3092\u5b9f\u884c\u3002<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-4449\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf11-5.webp\" alt=\"\" width=\"430\" height=\"80\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf11-5.webp 345w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf11-5-300x56.webp 300w\" sizes=\"(max-width: 430px) 100vw, 430px\" \/><\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001while\u6587\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u6761\u4ef6\u304c\u771f\u306e\u9593\u306f\u6307\u5b9a\u3055\u308c\u305f\u51e6\u7406\u3092\u7e70\u308a\u8fd4\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><strong>\u3057\u304b\u3057\u3001<span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">\u7121\u9650\u30eb\u30fc\u30d7\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u306f\u3001\u9069\u5207\u306b\u7d42\u4e86\u6761\u4ef6\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u91cd\u8981<\/span>\u3067\u3059\u3002<\/strong><\/p>\n<p style=\"text-align: center;\"><span style=\"color: #008080;\"><strong>\uff3c 2\u9031\u9593\u7121\u6599\u3067\u304a\u8a66\u3057\u3067\u304d\u307e\u3059\uff01 \uff0f<\/strong><\/span><br \/>\n<a class=\"btn_10\" href=\"https:\/\/www.miraiserver.ne.jp\/vps?utm_source=btn-vps&amp;utm_medium=referral&amp;utm_campaign=mirai-vps\" target=\"_blank\" rel=\"noopener noreferrer\">VPS\u3092\u4f7f\u3063\u3066\u307f\u308b<\/a><\/p>\n<h3 class=\"styled_h3\"><span id=\"break_continue_pass\">\u6761\u4ef6\u5206\u5c90\u5185\u3001\u30eb\u30fc\u30d7\u5185\u306e\u51e6\u7406\uff08break, continue, pass\uff09<\/span><\/h3>\n<p><strong><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">break\u3001continue\u3001pass\u306f\u3001\u6761\u4ef6\u5206\u5c90\u3084\u30eb\u30fc\u30d7\u306e\u4e2d\u3067\u30b3\u30fc\u30c9\u306e\u5b9f\u884c\u30d5\u30ed\u30fc\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/span><\/strong><\/p>\n<p>\u3053\u308c\u3089\u3092\u9069\u5207\u306b\u4f7f\u3046\u3053\u3068\u3067\u3001<span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">\u30b3\u30fc\u30c9\u306e\u52d5\u4f5c\u3092\u67d4\u8edf\u306b\u5236\u5fa1\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p>break\u306f\u3001\u30eb\u30fc\u30d7\u304b\u3089\u8131\u51fa\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u304c\u300capple\u300d\u3067\u3042\u308b\u5834\u5408\u3001\u30eb\u30fc\u30d7\u3092\u7d42\u4e86\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f8b\uff09<\/p>\n<p class=\"well2\"><strong>for fruit in [&#8220;apple&#8221;, &#8220;banana&#8221;, &#8220;cherry&#8221;]:<\/strong><br \/>\n<strong>if fruit == &#8220;apple&#8221;:<\/strong><br \/>\n<strong>break<\/strong><br \/>\n<strong>print(fruit)<\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-4450\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf12-5.webp\" alt=\"\" width=\"430\" height=\"76\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf12-5.webp 362w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf12-5-300x53.webp 300w\" sizes=\"(max-width: 430px) 100vw, 430px\" \/><\/p>\n<p>continue\u306f\u3001\u73fe\u5728\u306e\u7e70\u308a\u8fd4\u3057\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u3066\u3001\u30eb\u30fc\u30d7\u306e\u6b21\u306e\u7e70\u308a\u8fd4\u3057\u306b\u9032\u3080\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u304c\u300capple\u300d\u3067\u3042\u308b\u5834\u5408\u3001\u305d\u306e\u8981\u7d20\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u3066\u3001\u6b21\u306e\u8981\u7d20\u3092\u51e6\u7406\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f8b\uff09<\/p>\n<p class=\"well2\"><strong>for fruit in [&#8220;apple&#8221;, &#8220;banana&#8221;, &#8220;cherry&#8221;]:<\/strong><br \/>\n<strong>if fruit == &#8220;apple&#8221;:<\/strong><br \/>\n<strong>continue<\/strong><br \/>\n<strong>print(fruit)<\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-4452\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2025\/08\/\u753b\u50cf14-3.webp\" alt=\"\" width=\"430\" height=\"124\" \/><\/p>\n<p><span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\">pass\u306f\u3001\u4f55\u3082\u3057\u306a\u3044\u547d\u4ee4\u3067\u3059\u3002<\/span><\/p>\n<p>\u3053\u308c\u306b\u3088\u308a\u3001\u672a\u5b9f\u88c5\u306e\u95a2\u6570\u3084\u6761\u4ef6\u5206\u5c90\u3092\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u3068\u3057\u3066\u4fdd\u6301\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u6761\u4ef6\u5206\u5c90\u306eelse\u30d6\u30ed\u30c3\u30af\u3067\u4f55\u3082\u51e6\u7406\u3092\u884c\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u4f8b\uff09<\/p>\n<p class=\"well2\"><strong>if condition:<\/strong><br \/>\n<strong>print(&#8220;yes&#8221;)<\/strong><br \/>\n<strong>else:<\/strong><br \/>\n<strong>pass<\/strong><\/p>\n<h2 class=\"styled_h2\"><span id=\"i-5\">\u307e\u3068\u3081<\/span><\/h2>\n<p>Python\u306e\u57fa\u672c\u69cb\u6587\u3068\u5236\u5fa1\u6587\u306b\u3064\u3044\u3066\u5b66\u3093\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u521d\u5fc3\u8005\u306b\u3068\u3063\u3066Python\u306f\u8aad\u307f\u3084\u3059\u3044\u8a00\u8a9e\u3067\u3059\u306e\u3067\u3001\u4e00\u3064\u4e00\u3064\u3069\u306e\u3088\u3046\u306a\u610f\u5473\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306a\u306e\u304b\u3092\u8aad\u307f\u8fbc\u3093\u3067\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u4eca\u56de\u7d39\u4ecb\u3057\u305f\u5185\u5bb9\u3092\u3001\u5b9f\u969b\u306b\u624b\u3092\u52d5\u304b\u3057\u3066\u307f\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u6df1\u304fPython\u3092\u5b66\u3076\u3053\u3068\u304c\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u624b\u3092\u52d5\u304b\u3059\u969b\u306b\u3082\u3001<span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u81ea\u5206\u306e\u74b0\u5883\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001Python\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u3067\u5225\u306e.py\u30d5\u30a1\u30a4\u30eb\u3092\u547c\u3073\u51fa\u3057\u3066\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p>\u305d\u306e\u3088\u3046\u306a\u5c11\u3057\u3060\u3051\u30ec\u30d9\u30eb\u306e\u9ad8\u3044\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3057\u305f\u3044\u306a\u3089\u3001<span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\"><span style=\"color: #0000ff;\"><strong>\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fcVPS<\/strong><\/span>\u3067\u74b0\u5883\u69cb\u7bc9\u3092\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/span><\/p>\n<h2 class=\"styled_h2\"><span id=\"UnixLinuxVPS\">Unix\u3084Linux\u306eVPS\u306a\u3089\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc<\/span><\/h2>\n<p><a href=\"https:\/\/www.miraiserver.ne.jp\/?utm_source=article-other&amp;utm_medium=referral&amp;utm_campaign=miraiserver\" target=\"_blank\" rel=\"noopener\"><strong>\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc<\/strong><\/a>\u306f\u3001\u30a2\u30b7\u30b9\u30c8\u30a2\u30c3\u30d7\u682a\u5f0f\u4f1a\u793e\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b\u3001<strong>Unix\u7cfb\u30b5\u30fc\u30d0\u30fc<\/strong>\u306b\u7279\u5316\u3057\u305f\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9\u3067\u3059\u3002<\/p>\n<p><span class=\"q_underline q_underline1\" style=\"border-bottom-color: #fff799;\"><a href=\"https:\/\/www.miraiserver.ne.jp\/vps?utm_source=article-other&amp;utm_medium=referral&amp;utm_campaign=mirai-vps\" target=\"_blank\" rel=\"noopener\"><strong>\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u306eVPS<\/strong><\/a>\u3067\u306f\u3001<strong>\u9ad8\u901f\u51e6\u7406\u304c\u53ef\u80fd\u306aSSD<\/strong>\u3092<strong>\u5168\u30d7\u30e9\u30f3\u306b\u642d\u8f09<\/strong>\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">OS\u306f\u3001<b>Ubuntu<\/b>\u3084<b>Debian<\/b>\u3001<b>AlmaLinux<\/b>\u306a\u3069\u306e\u8c4a\u5bcc\u306a\u30e9\u30a4\u30f3\u30a2\u30c3\u30d7\u304b\u3089\u9078\u629e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><a href=\"https:\/\/www.miraiserver.ne.jp\/vps?utm_source=article-other&amp;utm_medium=referral&amp;utm_campaign=mirai-vps\" target=\"_blank\" rel=\"noopener\"><strong>2\u9031\u9593\u7121\u6599\u30c8\u30e9\u30a4\u30a2\u30eb<\/strong><\/a>\u3092\u5b9f\u65bd\u3057\u3066\u304a\u308a\u307e\u3059\u306e\u3067\u3001\u307e\u305a\u306f\u304a\u6c17\u8efd\u306b\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.miraiserver.ne.jp\/vps?utm_source=article-other&amp;utm_medium=referral&amp;utm_campaign=mirai-vps\" target=\"_blank\" rel=\"noopener\">\u25bc\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u25bc<\/a><a href=\"https:\/\/www.miraiserver.ne.jp\/vps?utm_source=article-other&amp;utm_medium=referral&amp;utm_campaign=mirai-vps\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-111 size-full\" src=\"http:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2022\/08\/02_336x280_a.png\" alt=\"Unix\u7cfbOS\u5c02\u9580\u306e\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9\u300c\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u300d\" width=\"336\" height=\"280\" srcset=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2022\/08\/02_336x280_a.png 336w, https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2022\/08\/02_336x280_a-300x250.png 300w\" sizes=\"(max-width: 336px) 100vw, 336px\" \/><\/a><\/p>\n<p><span class=\"q_underline q_underline2\" style=\"border-bottom-color: #99f9ff;\">\u30d7\u30e9\u30f3\u306e\u9078\u629e\u3067\u304a\u56f0\u308a\u306e\u5834\u5408\u306f\u3001\u305c\u3072\u4e00\u5ea6\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002<\/span><\/p>\n<p style=\"text-align: center;\"><a class=\"btn_10\" href=\"https:\/\/www.miraiserver.ne.jp\/formmail.html?utm_source=btn-vps&amp;utm_medium=referral&amp;utm_campaign=miraiserver\" target=\"_blank\" rel=\"noopener noreferrer\">\u304a\u554f\u3044\u5408\u308f\u305b\u306f\u3053\u3061\u3089<\/a><\/p>\n<div class=\"cardlink\">\r\n    <a class=\"image\" href=\"https:\/\/www.miraiserver.ne.jp\/column\/miraiserver_vps\/\">\r\n     <img src=\"https:\/\/blog.miraiserver.ne.jp\/wp-content\/uploads\/2023\/08\/VPS\u306b\u7533\u8fbc\u307f\u3001SSH\u63a5\u7d9a\u3059\u308b\u307e\u3067\u306e\u6d41\u308c\u3010\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u3011-2.webp\">\r\n    <\/a>\r\n    <div class=\"content\">\r\n     <div class=\"title_area\">\r\n      <p class=\"date\">2023.08.03<\/p>\r\n      <h4 class=\"title\">\r\n       <a href=\"https:\/\/www.miraiserver.ne.jp\/column\/miraiserver_vps\/\">VPS\u306b\u7533\u8fbc\u307f\u3001SSH\u63a5\u7d9a\u3059\u308b\u307e\u3067\u306e\u6d41\u308c\u3010\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u3011<\/a>\r\n      <\/h4>\r\n     <\/div>\r\n     <p class=\"desc\"><span>\u30aa\u30f3\u30e9\u30a4\u30f3\u30d3\u30b8\u30cd\u30b9\u3084Web\u30b5\u30a4\u30c8\u306e\u904b\u55b6\u3092\u59cb\u3081\u308b\u969b\u306b\u306f\u3001\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9\u306e\u4e2d\u304b\u3089\u81ea\u5206\u306e\u7528\u9014\u306b\u5408\u3063\u305f\u30b5\u30fc\u30d0\u30fc\u74b0\u5883\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u4e00\u822c\u7684\u3067\u3059\u3002...<\/span><\/p>\r\n    <\/div>\r\n   <\/div>\n\n","protected":false},"excerpt":{"rendered":"Python\u306e\u4eba\u6c17\u306e\u7406\u7531\u306e\u4e00\u3064\u306f\u3001\u305d\u306e\u30b7\u30f3\u30d7\u30eb\u3055\u3068\u8aad\u307f\u3084\u3059\u3055\u306b\u3042\u308a\u307e\u3059\u3002 \u521d\u5fc3\u8005\u3067\u3082\u66f8\u304d\u65b9\u306e\u30eb\u30fc\u30eb\u304c\u7406\u89e3\u3057\u3084\u3059\u3044\u3053\u3068\u304b\u3089\u5b66\u7fd2\u3057\u3084\u3059\u3044\u8a00\u8a9e\u3068\u8a00\u308f\u308c\u3066\u3044\u307e\u3059\u3002 \u672c\u8a18\u4e8b\u3067\u306f\u3001Python\u306e\u57fa\u672c\u69cb\u6587\u3084\u5236\u5fa1\u6587\u306b\u3064\u3044\u3066\u3001\u521d\u5fc3\u8005\u306b\u3082\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002 VPS\u306a\u3089\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc \uff3c2\u9031\u9593\u7121\u6599\u30fb\u5168\u30d7\u30e9\u30f3SSD\u642d\u8f09\uff0f \u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc\u3092\u7121\u6599\u3067\u8a66\u3059 \u76ee\u6b211 Python\u306e\u57fa\u672c\u69cb\u65871.1 \u8a18\u8ff0\u306e\u30eb\u30fc\u30eb1.2 \u30b3\u30e1\u30f3\u30c8\u306e\u66f8\u304d\u65b91.3 \u95a2\u6570\u3068\u306f1.4 \u5909\u6570\u3068\u306f2 Python\u306e\u5236\u5fa1\u65872.1 \u6761\u4ef6\u5206\u5c90(if\u6587)2.2 \u7e70\u308a\u8fd4\u3057\u51e6\u7406(for\u6587)2.3 \u6761\u4ef6\u304c\u6b63\u3057\u3044\u6642\u306b\u7e70\u308a\u8fd4\u3059\u51e6\u7406\uff08while\u6587\uff092.4 \u6761\u4ef6\u5206\u5c90\u5185\u3001\u30eb\u30fc\u30d7\u5185\u306e\u51e6\u7406\uff08break, continue, pass\uff093 \u307e\u3068\u30814 Unix\u3084Linux\u306eVPS\u306a\u3089\u30df\u30e9\u30a4\u30b5\u30fc\u30d0\u30fc Python\u306e\u57fa\u672c\u69cb\u6587 \u307e\u305a\u306f\u57fa\u672c\u3068\u306a\u308b\u69cb\u6587\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002 \u8a18\u8ff0\u306e\u30eb\u30fc\u30eb Python\u306f\u3001\u30b3\u30fc\u30c9\u304c\u4e00\u884c\u305a\u3064\u72ec\u7acb\u3057\u3066\u3044\u307e\u3059\u3002 Python\u3067\u306f\u3001C\u3084HTML\u306a\u3069\u306e\u3088\u3046\u306b\u884c\u306e\u7d42\u308f\u308a\u306b\u30bb\u30df\u30b3\u30ed\u30f3\uff08;\uff09\u3092\u52a0\u3048\u308b\u3053\u3068\u306f\u5fc5\u9808\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u30b3\u30fc\u30c9\u304c\u8aad\u307f\u3084\u3059\u304f\u306a\u308b\u3088\u3046\u3001\u6bb5\u843d\u5206\u3051\u3092\u3059\u308b\u305f\u3081\u306b\u7a7a\u884c\u3092\u4f7f\u7528\u3057\u3066\u3001\u5404\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u660e\u78ba\u306b\u533a\u5207\u308b\u3068\u826f\u3044\u3067\u3057\u3087\u3046\u3002 \u305f\u3060\u3057\u3001\u8907\u6570\u884c\u306b\u307e\u305f\u304c\u308b\u3088\u3046\u306a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u304c\u3067\u304d\u306a\u3044\u3068\u8aad\u307f\u306b\u304f\u3044\u3082\u306e\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u8907\u6570\u884c\u3067\u306e\u8868\u73fe\u3082\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 Python\u3067\u306f\u3001\u30a4\u30f3\u30c7\u30f3\u30c8\uff08\u5b57\u4e0b\u3052\uff09\u306b\u3088\u3063\u3066\u30b3\u30fc\u30c9\u306e\u30d6\u30ed\u30c3\u30af\u3092\u8868\u73fe\u3057\u307e\u3059\u3002 \u30a4\u30f3\u30c7\u30f3\u30c8\u306b\u3088\u3063\u3066\u8aad\u307f\u3084\u3059\u304f\u3059\u308b\u52b9\u679c\u3082\u3042\u308a\u307e\u3059\u3002 \u30b3\u30e1\u30f3\u30c8\u306e\u66f8\u304d\u65b9 \u30b3\u30e1\u30f3\u30c8\u306f\u4ed6\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3068\u540c\u69d8\u306b#\u8a18\u53f7\u3092\u4f7f\u3044\u307e\u3059\u3002 #\u304b\u3089\u6587\u672b\u307e\u3067\u306f\u30b3\u30e1\u30f3\u30c8\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u6642\u306b\u7121\u8996\u3055\u308c\u307e\u3059\u3002 # \u3053\u306e\u884c\u306f\u30b3\u30e1\u30f3\u30c8\u3067\u3059 \u4fee\u6b63\u3092\u3059\u308b\u969b\u306a\u3069\u4e00\u6642\u7684\u306b\u7279\u5b9a\u306e\u884c\u3092\u4e00\u6642\u7684\u306b\u52d5\u304b\u306a\u304f\u3057\u305f\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u306e\u6642\u306b\u3082\u30b3\u30e1\u30f3\u30c8\u304c\u5f79\u7acb\u3061\u307e\u3059\u3002 # print(&#8220;\u3053\u308c\u306f\u8868\u793a\u3055\u308c\u307e\u305b\u3093&#8221;) \u95a2\u6570\u3068\u306f \u95a2\u6570\u306f\u3001\u7e70\u308a\u8fd4\u3057\u4f7f\u7528\u3055\u308c\u308b\u7279\u5b9a\u306e\u51e6\u7406\u3092\u4e00\u3064\u306e\u30b3\u30fc\u30c9\u30d6\u30ed\u30c3\u30af\u306b\u307e\u3068\u3081\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u4f55\u5ea6\u3067\u3082\u547c\u3073\u51fa\u305b\u308b\u69cb\u9020\u3067\u3059\u3002 \u95a2\u6570\u306f\u300cdef\u300d\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u7528\u3044\u3066\u5b9a\u7fa9\u3057\u3001\u95a2\u6570\u540d\u3068\u62ec\u5f27\u5185\u306b\u5f15\u6570\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002 \u95a2\u6570\u672c\u4f53\u3067\u306f\u3001\u5b9f\u884c\u3057\u305f\u3044\u5177\u4f53\u7684\u306a\u51e6\u7406\u3092\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u7528\u3044\u3066\u8a18\u8f09\u3057\u307e\u3059\u3002 \u6b21\u306b\u300creturn\u300d\u306f\u95a2\u6570\u304b\u3089\u5024\u3092\u8fd4\u3059\u969b\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001\u6b21\u306e\u30b3\u30fc\u30c9\u306f\u6574\u6570\u306e\u8db3\u3057\u7b97\u3092\u884c\u3046\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u3001\u305d\u308c\u3092\u7528\u3044\u3066\u8907\u6570\u306e\u30ea\u30b9\u30c8\u306e\u5408\u8a08\u3092\u8a08\u7b97\u3057\u3066\u3044\u307e\u3059\u3002 # \u4e0e\u3048\u3089\u308c\u305f\u5024\u3092\u5408\u8a08\u3059\u308b\u95a2\u6570 def sum(numbers): total = 0 for i in [&hellip;]","protected":false},"author":1,"featured_media":4454,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[188,261,262],"tags":[22,175,269,270,271,272,288],"_links":{"self":[{"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/posts\/2379"}],"collection":[{"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/comments?post=2379"}],"version-history":[{"count":21,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/posts\/2379\/revisions"}],"predecessor-version":[{"id":4455,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/posts\/2379\/revisions\/4455"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/media\/4454"}],"wp:attachment":[{"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/media?parent=2379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/categories?post=2379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.miraiserver.ne.jp\/column\/wp-json\/wp\/v2\/tags?post=2379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}