{"id":1170,"date":"2024-11-15T20:34:59","date_gmt":"2024-11-15T12:34:59","guid":{"rendered":"https:\/\/gemmartdesign.com\/?p=1170"},"modified":"2024-11-29T20:39:36","modified_gmt":"2024-11-29T12:39:36","slug":"python-post9","status":"publish","type":"post","link":"https:\/\/gemmartdesign.com\/?p=1170","title":{"rendered":"Python\u7df4\u7fd2 #9-\u5efa\u7acb\u5be6\u9ad4\u7269\u4ef6"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u672c\u5468\u76ee\u6a19<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u719f\u6089Python\u7684\u57fa\u790e\u8a9e\u6cd5\u8207\u8cc7\u6599\u7d50\u69cb<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4efb\u52d9<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b78\u7fd2\u51fd\u6578\u7684\u5b9a\u7fa9\u548c\u4f7f\u7528\uff08Parameters\u3001Return Values\uff09<\/li>\n\n\n\n<li>\u7df4\u7fd2\u8a2d\u8a08\u548c\u4f7f\u7528\u51fd\u6578\uff0c\u4e26\u5b8c\u6210\u66f4\u591a\u5b57\u4e32\u8655\u7406\u7df4\u7fd2\uff08\u4f8b\u5982\u6587\u5b57\u67e5\u627e\u548c\u66ff\u63db\uff09<\/li>\n\n\n\n<li>\u5b78\u7fd2file open, write, read\u6307\u4ee4<\/li>\n\n\n\n<li>\u5b78\u7fd2json\u6307\u4ee4<\/li>\n\n\n\n<li>\u7df4\u7fd2\u5f9e\u516c\u958b\u7db2\u7ad9\u8b80\u53d6\u8cc7\u6599\u4e26\u5beb\u5165\u6587\u4ef6<\/li>\n\n\n\n<li>\u5efa\u7acb\u5be6\u9ad4\u7269\u4ef6\u8207\u5be6\u9ad4\u5c6c\u6027<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u5c08\u6848\u7df4\u7fd2<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>class Fullname:\n    def __init__(self,x,y):\n        self.x=x\n        self.y=y\n\nf1=Fullname(\"Will\",\"Liu\")\nprint(f1.x,f1.y)\nf2=Fullname(\"Steve\",\"Hung\")\nprint(f2.x,f2.y)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Output<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Will Liu\nSteve Hung<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u5468\u76ee\u6a19 \u719f\u6089Python\u7684\u57fa\u790e\u8a9e\u6cd5\u8207\u8cc7\u6599\u7d50\u69cb \u4efb\u52d9 \u5c08\u6848\u7df4&hellip;<\/p>\n","protected":false},"author":1,"featured_media":1240,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","pagelayer_contact_templates":[],"_pagelayer_content":"","_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[9],"tags":[],"class_list":["post-1170","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/posts\/1170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1170"}],"version-history":[{"count":4,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/posts\/1170\/revisions"}],"predecessor-version":[{"id":1241,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/posts\/1170\/revisions\/1241"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/media\/1240"}],"wp:attachment":[{"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}