{"id":198,"date":"2025-02-01T16:26:46","date_gmt":"2025-02-01T07:26:46","guid":{"rendered":"https:\/\/yowamon3.com\/?p=198"},"modified":"2025-02-01T19:19:33","modified_gmt":"2025-02-01T10:19:33","slug":"198","status":"publish","type":"post","link":"https:\/\/yowamon3.com\/?p=198","title":{"rendered":"Python\u306e\u4f8b\u5916\u51e6\u7406"},"content":{"rendered":"\n<h2 class=\"wp-block-heading jinr-heading d--bold\">\u4f8b\u5916\u51e6\u7406\u3068\u306f<\/h2>\n\n\n\n<p>\u4f8b\u5916\u51e6\u7406\u3068\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3068\u304d\u306b\u3001\u305d\u306e\u554f\u984c\u3092\u3046\u307e\u304f\u51e6\u7406\u3057\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u505c\u6b62\u3055\u305b\u305a\u306b\u6e08\u3080\u4ed5\u7d44\u307f\u306e\u3053\u3068\u3067\u3059\u3002<br>\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u304a\u3044\u3066\u8d77\u3053\u308a\u305d\u3046\u306a\u30a8\u30e9\u30fc\u3068\u3057\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list jinr-list\">\n<li>\u4f8b\u3048\u3070\u5b58\u5728\u3057\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3053\u3046\u3068\u3057\u3066\u3057\u307e\u3063\u305f<\/li>\n\n\n\n<li>\u6570\u5b57\u3092\u5165\u529b\u3057\u3066\u307b\u3057\u3044\u5834\u9762\u3067\u30e6\u30fc\u30b6\u30fc\u304c\u6570\u5b57\u4ee5\u5916\u3092\u5165\u529b\u3057\u3066\u304d\u305f\u3002<\/li>\n\n\n\n<li>\u5b58\u5728\u3057\u306a\u3044\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u3092\u6307\u5b9a\u3057\u3066\u3057\u307e\u3063\u305f<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u3046\u3044\u3063\u305f\u3068\u304d\u3001\u4f8b\u5916\u51e6\u7406\u304c\u306a\u3051\u308c\u3070\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u505c\u6b62\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u4f8b\u5916\u51e6\u7406\u3092\u66f8\u304f\u3053\u3068\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7d9a\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading jinr-heading d--bold\">\u4f8b\u5916\u51e6\u7406\u306e\u66f8\u304d\u65b9<\/h2>\n\n\n\n<p>\u4f8b\u5916\u51e6\u7406\u306e\u69cb\u6587\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<br>\u30dd\u30a4\u30f3\u30c8\u3068\u306a\u308b\u306e\u306f\u300c\u3053\u30531\u300d\u300c\u3053\u30532\u300d\u3068\u66f8\u3044\u3066\u3042\u308b\u5834\u6240\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>while True:\n\ttry: #\u3053\u3053\uff11\n\t\tnumber = int(input(&#39;\u6570\u5b57\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044&#39;))\n\t\tresult = 10 \/ number\n\t\tprint(f&#39;\u8a08\u7b97\u7d50\u679c\uff1a {result}&#39;)\n\n\texcept ZeroDivisionError:\u3000#\u3053\u30532\n\t\tprint(&#39;0\u3067\u5272\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u5225\u306e\u6570\u5b57\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044&#39;)\n\texcept ValueError:\n\t\tprint(&#39;\u6570\u5b57\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044&#39;)<\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list jinr-list\">\n<li>try<br>\u3053\u306e\u30cd\u30b9\u30c8\u306e\u7bc4\u56f2\u3067\u767a\u751f\u3057\u305f\u4f8b\u5916\u304c\u767a\u751f\u3057\u305f\u3068\u304d\u306b\u4f8b\u5916\u51e6\u7406\u304c\u884c\u308f\u308c\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list jinr-list\">\n<li>except<br>\u767a\u751f\u3057\u305f\u4f8b\u5916\u306b\u5fdc\u3058\u305f\u51e6\u7406\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<br>except\u306e\u5f8c\u306b\u4f8b\u5916\u51e6\u7406\u3092\u884c\u3044\u305f\u3044\u4f8b\u5916\u306e\u7a2e\u985e\u3092\u5ba3\u8a00\u3057\u307e\u3059\u3002\u4f8b\u306e\u5834\u5408\u3001\u6570\u5024\u306b\u5909\u63db\u3067\u304d\u306a\u3044\u6587\u5b57\u304c\u5165\u529b\u3055\u308c\u305f\u5834\u5408\u30680\u304c\u5165\u529b\u3055\u308c\u305f\u3053\u3068\u306b\u3088\u308b0\u9664\u7b97\u304c\u884c\u308f\u308c\u305f\u5834\u5408\u306e\u51e6\u7406\u3092\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\u3002<br>\u4f8b\u5916\u306e\u7a2e\u985e\u306b\u5fdc\u3058\u305f\u51e6\u7406\u3092\u3057\u305f\u3044\u5834\u5408\u306fexcept\u3092\u8907\u6570\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3067\u5b9f\u73fe\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading jinr-heading d--bold\">finally<\/h3>\n\n\n\n<p>finaly\u3068\u3044\u3046\u306e\u306ftry except\u306e\u51e6\u7406\u304c\u884c\u308f\u308c\u305f\u3068\u304d\u306b\u6700\u5f8c\u306b\u5fc5\u305a\u884c\u3046\u51e6\u7406\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u5834\u5408\u306f\u3001\u4f8b\u5916\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u3082\u767a\u751f\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u3082\u5e38\u306b\u300c\u51e6\u7406\u3092\u518d\u958b\u3057\u307e\u3059\u3002\u300d\u3068\u3044\u3046\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>while True:\n\ttry: #\u3053\u3053\uff11\n\t\tnumber = int(input(&#39;\u6570\u5b57\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044&#39;))\n\t\tresult = 10 \/ number\n\t\tprint(f&#39;\u8a08\u7b97\u7d50\u679c\uff1a {result}&#39;)\n\n\texcept ZeroDivisionError:\u3000#\u3053\u30532\n\t\tprint(&#39;0\u3067\u5272\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u5225\u306e\u6570\u5b57\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044&#39;)\n\texcept ValueError:\n\t\tprint(&#39;\u6570\u5b57\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044&#39;)\n\tfinaly:\n\t\tprint(&#39;\u51e6\u7406\u3092\u518d\u958b\u3057\u307e\u3059\u3002&#39;)<\/code><\/pre><\/div>\n\n\n\n<p>with\u3092\u5229\u7528\u305b\u305a\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u5fc5\u305a\u30af\u30ed\u30fc\u30ba\u3057\u305f\u308a\u3001\u30bd\u30b1\u30c3\u30c8\u901a\u4fe1\u3092\u5207\u65ad\u3059\u308b\u306a\u3069\u5fc5\u305a\u884c\u3063\u3066\u307b\u3057\u3044\u51e6\u7406\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f8b\u5916\u51e6\u7406\u3068\u306f \u4f8b\u5916\u51e6\u7406\u3068\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3068\u304d\u306b\u3001\u305d\u306e\u554f\u984c\u3092\u3046\u307e\u304f\u51e6\u7406\u3057\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u505c\u6b62\u3055\u305b\u305a\u306b\u6e08\u3080\u4ed5\u7d44\u307f\u306e\u3053\u3068\u3067\u3059\u3002\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u304a\u3044\u3066\u8d77\u3053\u308a\u305d\u3046\u306a\u30a8\u30e9\u30fc\u3068\u3057\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002 \u3053\u3046\u3044\u3063\u305f\u3068\u304d\u3001 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jinr_url_youtube":"","_jinr_pip_youtube":false,"_jinr_time_youtube":"","_jinr_thumb_youtube":"","_jinr_media_youtube":"","_jinr_category_edit":false,"_jinr_category":"","_jinr_title_display":false,"_jinr_snsbutton_display":false,"_jinr_ads_display":false,"_jinr_thumbnail_display":false,"_jinr_profile_display":false,"_jinr_representations_display":false,"_jinr_relatedpost_display":false,"_jinr_sidebar1col_display":false,"_jinr_sidebar2col_display":false,"_jinr_seotitle_display":"","_jinr_description_display":"","_jinr_keyword_display":"","_jinr_hastag_display":"","_jinr_canonical_display":"","_jinr_noindex_display":false,"_jinr_paidpost":false,"_jinr_paidpost_product_id":"","_jinr_headtag_article":"","footnotes":""},"categories":[50],"tags":[48,80,55],"class_list":["post-198","post","type-post","status-publish","format-standard","hentry","category-python","tag-python","tag-80","tag-55"],"views":"5","_links":{"self":[{"href":"https:\/\/yowamon3.com\/index.php?rest_route=\/wp\/v2\/posts\/198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yowamon3.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yowamon3.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yowamon3.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yowamon3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=198"}],"version-history":[{"count":2,"href":"https:\/\/yowamon3.com\/index.php?rest_route=\/wp\/v2\/posts\/198\/revisions"}],"predecessor-version":[{"id":201,"href":"https:\/\/yowamon3.com\/index.php?rest_route=\/wp\/v2\/posts\/198\/revisions\/201"}],"wp:attachment":[{"href":"https:\/\/yowamon3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yowamon3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yowamon3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}