{"url":"https://coffee-guhaw.hateblo.jp/entry/2025/07/19/000000","published":"2025-07-19 00:00:00","provider_name":"Hatena Blog","categories":["python"],"blog_title":"Bus error\u3068Segmentation fault\u306b\u56f0\u3063\u305f\u3089\u898b\u308b\u30d6\u30ed\u30b0","blog_url":"https://coffee-guhaw.hateblo.jp/","provider_url":"https://hatena.blog","width":"100%","author_url":"https://blog.hatena.ne.jp/coffee_kabu/","author_name":"coffee_kabu","title":"\u3010python3\u3011\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306e\u4f7f\u3044\u65b9","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcoffee-guhaw.hateblo.jp%2Fentry%2F2025%2F07%2F19%2F000000\" title=\"\u3010python3\u3011\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306e\u4f7f\u3044\u65b9 - Bus error\u3068Segmentation fault\u306b\u56f0\u3063\u305f\u3089\u898b\u308b\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"height":"190","description":"\u25a0 \u53c2\u8003 : Python\u3067\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\uff08global\uff09\u5909\u6570\u306e\u5ba3\u8a00\u65b9\u6cd5 var = 1 def add_ten(x): global var var = 10 print var + xadd_ten(2) # 12 print var # 10\u2191\u306e\u30ea\u30f3\u30af\u304b\u3089\u501f\u308a\u3066\u304d\u307e\u3057\u305f1. \u95a2\u6570\u306e\u5916\u3067\u5909\u6570\u3092\u4f7f\u3046 2. \u95a2\u6570\u306e\u4e2d\u3067global\u3092\u3064\u3051\u3066\u5909\u6570\u3092\u5ba3\u8a00\u3059\u308b 3. \u95a2\u6570\u306e\u4e2d\u3067\u5909\u6570\u3092\u4f7f\u3046 4. \u95a2\u6570\u306e\u5916\u3067\u3082\u305d\u306e\u5024\u304c\u4ee3\u5165\u3055\u308c\u3066\u308b \u30e9\u30f3\u30ad\u30f3\u30b0\u53c2\u52a0\u4e2d\u3067\u3059 \u2193\u30af\u30ea\u30c3\u30af\u3057\u3066\u3044\u305f\u3060\u3051\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\u301c\u30e9\u30f3\u30ad\u30f3\u30b0\u53c2\u52a0\u4e2dPython \u30e9\u30f3\u30ad\u30f3\u30b0\u53c2\u52a0\u4e2dHTML \u30e9\u30f3\u30ad\u30f3\u30b0\u53c2\u52a0\u4e2dMac","version":"1.0","type":"rich"}