{"id":3678,"date":"2020-04-13T00:46:31","date_gmt":"2020-04-12T22:46:31","guid":{"rendered":"https:\/\/myoceane.fr\/?p=3678"},"modified":"2020-06-08T16:24:11","modified_gmt":"2020-06-08T14:24:11","slug":"python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables","status":"publish","type":"post","link":"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/","title":{"rendered":"[Python\u521d\u5b78\u8005] Variables \u8b8a\u6578"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<h5><strong>\u8b8a\u6578\u7684\u540d\u7a31\uff1a<\/strong><\/h5>\n<ol>\n<li>\u958b\u982d\u5fc5\u9808\u662f\u5b57\u6bcd\u6216\u5e95\u7dda<\/li>\n<li>\u958b\u982d\u4e0d\u80fd\u662f\u6578\u5b57<\/li>\n<li>\u540d\u7a31\u53ea\u80fd\u5305\u542b\u5b57\u6bcd(A-z)\uff0c\u6578\u5b57(0-9)\u548c\u5e95\u7dda(_)<\/li>\n<li>\u5b57\u6bcd\u5927\u5c0f\u5beb\u4ee3\u8868\u7684\u8b8a\u6578\u4e0d\u540c\uff08\u4f8b\u5982oceane\uff0cOceane\u548cOCEANE\u4ee3\u8868\u7684\u8b8a\u6578\u7686\u4e0d\u540c\uff09<\/li>\n<\/ol>\n<h4>\u591a\u6a23\u8b8a\u6578\u5448\u73fe\uff1a<\/h4>\n<pre class=\"lang:python\">x, y, z = \"notre\", \"petite\", \"Oceane\"\nprint(x)\nprint(y)\nprint(z)<\/pre>\n<p>\u7d50\u679c\u6703\u51fa\u73fe\uff1a<\/p>\n\n\n<pre class=\"lang:python\">notre\npetite\nOceane<\/pre>\n\n\n<h5>\u5982\u4f55\u4f7f\u7528\u52a0\u865f +&nbsp;<\/h5>\n<h6>a) \u7576\u300c\u5b57\u4e32\u300d\uff08\u9700\u52a0\u4e0a\u96d9\u5f15\u865f &#8221; &#8220;\uff09\u7528\u52a0\u865f\u7d50\u5408\uff0c\u5247\u6703\u5c07\u5b57\u4e32\u63a5\u5728\u4e00\u8d77<\/h6>\n<pre class=\"lang:python\">x = \"Oceane is \"\ny = \"cute\"\nprint (x + y)<\/pre>\n\n\n<p>\u5f97\u5230\u7684\u7d50\u679c\u70ba\uff1a<\/p>\n<pre class=\"lang:python\">Oceane is cute<\/pre>\n\n\n<h6>b) \u7576\u300c\u6578\u5b57\u300d\u7528\u52a0\u865f\u7d50\u5408\uff0c\u5247<\/h6>\n<pre class=\"lang:python\">x = 100\ny = 88\nprint (x + y)<\/pre>\n\n\n<p>\u5f97\u5230\u7684\u7d50\u679c\u70ba<\/p>\n<pre class=\"lang:python\">188<\/pre>\n\n\n<h4>&nbsp;<\/h4>\n<h4>\u5168\u57df\u8b8a\u6578(Global variable)\u548c\u5340\u57df\u8b8a\u6578(Local variable)<\/h4>\n\n\n<p>\u4ee5\u4e0b\u4f8b\u5b50\uff0c\u7b2c\u4e00\u500b\u51fa\u73fe\u7684 x \uff08#\u8b8a\u65781\uff0cx = &#8220;cute&#8221;\uff09 \u662f\u5168\u57df\u8b8a\u6578\uff0c\u5728\u6574\u500b\u7a0b\u5f0f\u8a9e\u8a00\u4e2d\u901a\u7528\u3002\u800c\u7b2c\u4e8c\u500b\u51fa\u73fe\u7684 x \uff08#\u8b8a\u65782\uff0cx = &#8221; adorable&#8221;\uff09 \u662f\u5340\u57df\u8b8a\u6578\uff0c\u53ea\u6709\u5728def myfun(): \u6b64\u5340\u57df\u5167\u6703\u51fa\u73fe\u3002<\/p>\n<p><br>Note: <a href=\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85\/?preview_id=3625&amp;preview_nonce=88326fc310&amp;preview=true\">\u4e95\u5b57\u865f#\u5f8c\u7684\u6587\u5b57\u70ba\u8a3b\u8a18\uff0c\u4e0d\u6703\u5f71\u97ff\u7a0b\u5f0f\u8a9e\u8a00\uff08\u5982\u524d\u6587\uff09<\/a><\/p>\n<pre class=\"lang:python\">x = \"cute\"\n\ndef myfunc():\n    x = \"adorable\"\n    print(\"Oceane is \" + x) \n\nmyfunc()\nprint(\"Oceane is \" + x) <\/pre>\n\n\n\n<p>\u56e0\u6b64\u7d50\u679c\u662f\uff1a<\/p>\n<p>\u7b2c\u4e00\u500b\u5728def myfunc(): \u4e2d\uff0cprint\u5728\u5340\u57df\u8b8a\u6578\u4e2d\u5b9a\u7fa9\u7684#\u8b8a\u65782\uff0c\u7d50\u679c\u70baOceane is adorable\u3002<\/p>\n<p>\u800c\u7b2c\u4e8c\u500bprint\u5728\u5168\u57df\u8b8a\u6578\u4e2d\u5b9a\u7fa9\u7684#\u8b8a\u65781\uff0c\u7d50\u679c\u70baOceane is cute\u3002<\/p>\n<pre class=\"lang:python\">Oceane is adorable\nOceane is cute<\/pre>\n\n\n\n<p>\u4f46\u662f\uff0c\u5047\u5982\u5728def myfucn():\u4e2d\u7684\u8b8a\u6578\uff08#\u8b8a\u65782\uff0cx = &#8221; adorable&#8221;\uff09\u8a3b\u8a18\u70bax = global\uff0c\u5247#\u8b8a\u65782\u5c07\u53d6\u4ee3#\u8b8a\u65781 \uff08#\u8b8a\u65781\uff0cx = &#8220;cute&#8221;\uff09\uff0c\u6210\u70ba\u5168\u57df\u8b8a\u6578\u3002<\/p>\n<pre class=\"lang:python\">x = \"cute\"\n\ndef myfunc():\n    global x\n    x = \"adorable\"\n    print(\"Oceane is \" + x)\n\nmyfunc()\nprint(\"Oceane is \" + x)<\/pre>\n\n\n\n<p>\u7d50\u679c1\u548c\u7d50\u679c2\u7686\u70ba\uff1a<\/p>\n<pre class=\"lang:python\">Oceane is adorable\nOceane is adorable<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8b8a\u6578\u7684\u540d\u7a31\uff1a<br \/>\n1. \u958b\u982d\u5fc5\u9808\u662f\u5b57\u6bcd\u6216\u5e95\u7dda<br \/>\n2. \u958b\u982d\u4e0d\u80fd\u662f\u6578\u5b57<br \/>\n3. \u540d\u7a31\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\uff0c\u6578\u5b57\u548c\u5e95\u7dda<br \/>\n4. \u5b57\u6bcd\u5927\u5c0f\u5beb\u4ee3\u8868\u7684\u8b8a\u6578\u4e0d\u540c<\/p>\n","protected":false},"author":3,"featured_media":5107,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,176],"tags":[531,532,19,525,524,529,527,530,528,526],"class_list":["post-3678","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it-technology","category-python","tag-global-variable","tag-local-variable","tag-python","tag-variable","tag-variables","tag-529","tag-527","tag-530","tag-528","tag-526"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Python\u521d\u5b78\u8005] Variables \u8b8a\u6578 - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane<\/title>\n<meta name=\"description\" content=\"\u5168\u57df\u8b8a\u6578(Global variable)\u548c\u5340\u57df\u8b8a\u6578(Local variable)\u4ee5\u4e0b\u4f8b\u5b50\uff0c\u7b2c\u4e00\u500b\u51fa\u73fe\u7684 x \uff08#\u8b8a\u65781\uff09\u662f\u5168\u57df\u8b8a\u6578\uff0c\u5728\u6574\u500b\u7a0b\u5f0f\u8a9e\u8a00\u4e2d\u901a\u7528\u3002\u800c\u7b2c\u4e8c\u500b\u51fa\u73fe\u7684 x\uff08#\u8b8a\u65782\uff09\u662f\u5340\u57df\u8b8a\u6578\uff0c\u53ea\u6709\u5728def myfun(): \u6b64\u5340\u57df\u5167\u6703\u51fa\u73fe\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/myoceane.fr\/index.php\/python\u521d\u5b78\u8005-\u8b8a\u6578variables\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Python\u521d\u5b78\u8005] Variables \u8b8a\u6578 - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane\" \/>\n<meta property=\"og:description\" content=\"\u5168\u57df\u8b8a\u6578(Global variable)\u548c\u5340\u57df\u8b8a\u6578(Local variable)\u4ee5\u4e0b\u4f8b\u5b50\uff0c\u7b2c\u4e00\u500b\u51fa\u73fe\u7684 x \uff08#\u8b8a\u65781\uff09\u662f\u5168\u57df\u8b8a\u6578\uff0c\u5728\u6574\u500b\u7a0b\u5f0f\u8a9e\u8a00\u4e2d\u901a\u7528\u3002\u800c\u7b2c\u4e8c\u500b\u51fa\u73fe\u7684 x\uff08#\u8b8a\u65782\uff09\u662f\u5340\u57df\u8b8a\u6578\uff0c\u53ea\u6709\u5728def myfun(): \u6b64\u5340\u57df\u5167\u6703\u51fa\u73fe\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/myoceane.fr\/index.php\/python\u521d\u5b78\u8005-\u8b8a\u6578variables\/\" \/>\n<meta property=\"og:site_name\" content=\"\u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-12T22:46:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-06-08T14:24:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/myoceane.fr\/wp-content\/uploads\/2020\/06\/PythonVariables-2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u6ab8\u6aac\u5abd\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6ab8\u6aac\u5abd\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/\"},\"author\":{\"name\":\"\u6ab8\u6aac\u5abd\",\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4131a9a9e8a1517447647089109fe4f3\"},\"headline\":\"[Python\u521d\u5b78\u8005] Variables \u8b8a\u6578\",\"datePublished\":\"2020-04-12T22:46:31+00:00\",\"dateModified\":\"2020-06-08T14:24:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/\"},\"wordCount\":42,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\"},\"image\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/myoceane.fr\/wp-content\/uploads\/2020\/06\/PythonVariables-2.jpg\",\"keywords\":[\"global variable\",\"local variable\",\"Python\",\"variable\",\"variables\",\"\u5168\u57df\u8b8a\u6578\",\"\u521d\u5b78\u8005\",\"\u5340\u57df\u8b8a\u6578\",\"\u591a\u6a23\u8b8a\u6578\",\"\u8b8a\u6578\"],\"articleSection\":[\"IT Technology\",\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/\",\"url\":\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/\",\"name\":\"[Python\u521d\u5b78\u8005] Variables \u8b8a\u6578 - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane\",\"isPartOf\":{\"@id\":\"https:\/\/myoceane.fr\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/myoceane.fr\/wp-content\/uploads\/2020\/06\/PythonVariables-2.jpg\",\"datePublished\":\"2020-04-12T22:46:31+00:00\",\"dateModified\":\"2020-06-08T14:24:11+00:00\",\"description\":\"\u5168\u57df\u8b8a\u6578(Global variable)\u548c\u5340\u57df\u8b8a\u6578(Local variable)\u4ee5\u4e0b\u4f8b\u5b50\uff0c\u7b2c\u4e00\u500b\u51fa\u73fe\u7684 x \uff08#\u8b8a\u65781\uff09\u662f\u5168\u57df\u8b8a\u6578\uff0c\u5728\u6574\u500b\u7a0b\u5f0f\u8a9e\u8a00\u4e2d\u901a\u7528\u3002\u800c\u7b2c\u4e8c\u500b\u51fa\u73fe\u7684 x\uff08#\u8b8a\u65782\uff09\u662f\u5340\u57df\u8b8a\u6578\uff0c\u53ea\u6709\u5728def myfun(): \u6b64\u5340\u57df\u5167\u6703\u51fa\u73fe\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#primaryimage\",\"url\":\"https:\/\/myoceane.fr\/wp-content\/uploads\/2020\/06\/PythonVariables-2.jpg\",\"contentUrl\":\"https:\/\/myoceane.fr\/wp-content\/uploads\/2020\/06\/PythonVariables-2.jpg\",\"width\":1200,\"height\":675},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/myoceane.fr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Python\u521d\u5b78\u8005] Variables \u8b8a\u6578\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/myoceane.fr\/#website\",\"url\":\"https:\/\/myoceane.fr\/\",\"name\":\"M-Y-Oceane \u60f3\u65b9\u6d89\u6cd5\u3002\u91cf\u74f6\u5916\u7684\u5929\u7a7a\",\"description\":\"\u60f3\u65b9\u6d89\u6cd5, France, Taiwan, Health, Information Technology\",\"publisher\":{\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/myoceane.fr\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\",\"name\":\"\u6ab8\u6aac\u7238\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g\",\"caption\":\"\u6ab8\u6aac\u7238\"},\"logo\":{\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4131a9a9e8a1517447647089109fe4f3\",\"name\":\"\u6ab8\u6aac\u5abd\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cf16944a7cf34c4bed48684016e7de5a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cf16944a7cf34c4bed48684016e7de5a?s=96&d=mm&r=g\",\"caption\":\"\u6ab8\u6aac\u5abd\"},\"url\":\"https:\/\/myoceane.fr\/index.php\/author\/anataliechougmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Python\u521d\u5b78\u8005] Variables \u8b8a\u6578 - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","description":"\u5168\u57df\u8b8a\u6578(Global variable)\u548c\u5340\u57df\u8b8a\u6578(Local variable)\u4ee5\u4e0b\u4f8b\u5b50\uff0c\u7b2c\u4e00\u500b\u51fa\u73fe\u7684 x \uff08#\u8b8a\u65781\uff09\u662f\u5168\u57df\u8b8a\u6578\uff0c\u5728\u6574\u500b\u7a0b\u5f0f\u8a9e\u8a00\u4e2d\u901a\u7528\u3002\u800c\u7b2c\u4e8c\u500b\u51fa\u73fe\u7684 x\uff08#\u8b8a\u65782\uff09\u662f\u5340\u57df\u8b8a\u6578\uff0c\u53ea\u6709\u5728def myfun(): \u6b64\u5340\u57df\u5167\u6703\u51fa\u73fe\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/myoceane.fr\/index.php\/python\u521d\u5b78\u8005-\u8b8a\u6578variables\/","og_locale":"en_US","og_type":"article","og_title":"[Python\u521d\u5b78\u8005] Variables \u8b8a\u6578 - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","og_description":"\u5168\u57df\u8b8a\u6578(Global variable)\u548c\u5340\u57df\u8b8a\u6578(Local variable)\u4ee5\u4e0b\u4f8b\u5b50\uff0c\u7b2c\u4e00\u500b\u51fa\u73fe\u7684 x \uff08#\u8b8a\u65781\uff09\u662f\u5168\u57df\u8b8a\u6578\uff0c\u5728\u6574\u500b\u7a0b\u5f0f\u8a9e\u8a00\u4e2d\u901a\u7528\u3002\u800c\u7b2c\u4e8c\u500b\u51fa\u73fe\u7684 x\uff08#\u8b8a\u65782\uff09\u662f\u5340\u57df\u8b8a\u6578\uff0c\u53ea\u6709\u5728def myfun(): \u6b64\u5340\u57df\u5167\u6703\u51fa\u73fe\u3002","og_url":"https:\/\/myoceane.fr\/index.php\/python\u521d\u5b78\u8005-\u8b8a\u6578variables\/","og_site_name":"\u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","article_published_time":"2020-04-12T22:46:31+00:00","article_modified_time":"2020-06-08T14:24:11+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/myoceane.fr\/wp-content\/uploads\/2020\/06\/PythonVariables-2.jpg","type":"image\/jpeg"}],"author":"\u6ab8\u6aac\u5abd","twitter_card":"summary_large_image","twitter_misc":{"Written by":"\u6ab8\u6aac\u5abd","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#article","isPartOf":{"@id":"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/"},"author":{"name":"\u6ab8\u6aac\u5abd","@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4131a9a9e8a1517447647089109fe4f3"},"headline":"[Python\u521d\u5b78\u8005] Variables \u8b8a\u6578","datePublished":"2020-04-12T22:46:31+00:00","dateModified":"2020-06-08T14:24:11+00:00","mainEntityOfPage":{"@id":"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/"},"wordCount":42,"commentCount":0,"publisher":{"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b"},"image":{"@id":"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#primaryimage"},"thumbnailUrl":"https:\/\/myoceane.fr\/wp-content\/uploads\/2020\/06\/PythonVariables-2.jpg","keywords":["global variable","local variable","Python","variable","variables","\u5168\u57df\u8b8a\u6578","\u521d\u5b78\u8005","\u5340\u57df\u8b8a\u6578","\u591a\u6a23\u8b8a\u6578","\u8b8a\u6578"],"articleSection":["IT Technology","Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/","url":"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/","name":"[Python\u521d\u5b78\u8005] Variables \u8b8a\u6578 - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","isPartOf":{"@id":"https:\/\/myoceane.fr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#primaryimage"},"image":{"@id":"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#primaryimage"},"thumbnailUrl":"https:\/\/myoceane.fr\/wp-content\/uploads\/2020\/06\/PythonVariables-2.jpg","datePublished":"2020-04-12T22:46:31+00:00","dateModified":"2020-06-08T14:24:11+00:00","description":"\u5168\u57df\u8b8a\u6578(Global variable)\u548c\u5340\u57df\u8b8a\u6578(Local variable)\u4ee5\u4e0b\u4f8b\u5b50\uff0c\u7b2c\u4e00\u500b\u51fa\u73fe\u7684 x \uff08#\u8b8a\u65781\uff09\u662f\u5168\u57df\u8b8a\u6578\uff0c\u5728\u6574\u500b\u7a0b\u5f0f\u8a9e\u8a00\u4e2d\u901a\u7528\u3002\u800c\u7b2c\u4e8c\u500b\u51fa\u73fe\u7684 x\uff08#\u8b8a\u65782\uff09\u662f\u5340\u57df\u8b8a\u6578\uff0c\u53ea\u6709\u5728def myfun(): \u6b64\u5340\u57df\u5167\u6703\u51fa\u73fe\u3002","breadcrumb":{"@id":"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#primaryimage","url":"https:\/\/myoceane.fr\/wp-content\/uploads\/2020\/06\/PythonVariables-2.jpg","contentUrl":"https:\/\/myoceane.fr\/wp-content\/uploads\/2020\/06\/PythonVariables-2.jpg","width":1200,"height":675},{"@type":"BreadcrumbList","@id":"https:\/\/myoceane.fr\/index.php\/python%e5%88%9d%e5%ad%b8%e8%80%85-%e8%ae%8a%e6%95%b8variables\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/myoceane.fr\/"},{"@type":"ListItem","position":2,"name":"[Python\u521d\u5b78\u8005] Variables \u8b8a\u6578"}]},{"@type":"WebSite","@id":"https:\/\/myoceane.fr\/#website","url":"https:\/\/myoceane.fr\/","name":"M-Y-Oceane \u60f3\u65b9\u6d89\u6cd5\u3002\u91cf\u74f6\u5916\u7684\u5929\u7a7a","description":"\u60f3\u65b9\u6d89\u6cd5, France, Taiwan, Health, Information Technology","publisher":{"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/myoceane.fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b","name":"\u6ab8\u6aac\u7238","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/myoceane.fr\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g","caption":"\u6ab8\u6aac\u7238"},"logo":{"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4131a9a9e8a1517447647089109fe4f3","name":"\u6ab8\u6aac\u5abd","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/myoceane.fr\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cf16944a7cf34c4bed48684016e7de5a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf16944a7cf34c4bed48684016e7de5a?s=96&d=mm&r=g","caption":"\u6ab8\u6aac\u5abd"},"url":"https:\/\/myoceane.fr\/index.php\/author\/anataliechougmail-com\/"}]}},"amp_enabled":false,"_links":{"self":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts\/3678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/comments?post=3678"}],"version-history":[{"count":56,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts\/3678\/revisions"}],"predecessor-version":[{"id":5108,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts\/3678\/revisions\/5108"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/media\/5107"}],"wp:attachment":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/media?parent=3678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/categories?post=3678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/tags?post=3678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}