\r\n>>> a=(1,)\r\n>>> b=a\r\n>>> b\r\n(1,)\r\n>>> b,=a\r\n>>> b\r\n1\r\n<\/pre>\n\u6700\u540eprint\u6253\u5370\u53d8\u91cf\u52a0,\u5b9e\u73b0\u8fde\u7eed\u6253\u5370\u4e0d\u6362\u884c\u7684\u64cd\u4f5c\u5728python3\u4e2d\u884c\u4e0d\u901a\u4e86<\/p>\n
\r\nPython 3.7.3 (default, Nov 15 2019, 04:04:52) \r\n[Clang 11.0.0 (clang-1100.0.33.16)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> for i in range(0,5):\r\n... print(i)\r\n... \r\n0\r\n1\r\n2\r\n3\r\n4\r\n>>> for i in range(0,5):\r\n... print(i,)\r\n... \r\n0\r\n1\r\n2\r\n3\r\n4\r\n<\/pre>\nps\uff1a\u4e0b\u9762\u770b\u4e0bPython\u4e2d\u9017\u53f7\u7684\u5999\u7528
\n\u95f2\u7740\u6ca1\u4e8b\u6253\u7b97\u7528Python\u5237\u4e00\u904dpat\uff0c\u8f93\u51fa\u8fc7\u7a0b\u4e2d\u9047\u5230\u4e86\u4e00\u4e2a\u8fd9\u6837\u7684\u95ee\u9898\uff1a
\n\u9898\u76ee1002\u9898\u76ee\u8981\u6c42 \u5728\u4e00\u884c\u5185\u8f93\u51fan\u7684\u5404\u4f4d\u6570\u5b57\u4e4b\u548c\u7684\u6bcf\u4e00\u4f4d\uff0c\u62fc\u97f3\u6570\u5b57\u95f4\u67091 \u7a7a\u683c\uff0c\u4f46\u4e00\u884c\u4e2d\u6700\u540e\u4e00\u4e2a\u62fc\u97f3\u6570\u5b57\u540e\u6ca1\u6709\u7a7a\u683c\uff0c
\n\u4f46\u662fPython\u4e2dprint\u8bed\u53e5\u9ed8\u8ba4\u4f1a\u5728\u540e\u9762\u52a0\u4e0a\u6362\u884c\u7b26\uff0c\u52a0\u4e86\u9017\u53f7\u4e4b\u540e \u5de7\u5999\u7684\u5c06\u6362\u884c\u53d8\u6210\u4e86\u7a7a\u683c
\n\u9644\u4e0a1002\u4ee3\u7801\uff1a<\/p>\n
\r\n#!\/usr\/bin\/python\r\nimport sys\r\nn = int(sys.argv[1])\r\ncount =0\r\nwhile n!=0:\r\n count = count + n%10\r\n n = n\/10\r\nans=[ ]\r\nwhile count!=0:\r\n ans.insert(0,count%10)\r\n count=count\/10\r\ndic = {0:\"ling\", 1:\"yi\", 2:\"er\", 3:\"san\", 4:\"si\", 5:\"wu\", 6:\"liu\", 7:\"qi\", 8:\"ba\", 9:\"jiu\"}\r\nfor i in range(len(ans)):\r\n print dic[ans[i]],\r\n<\/pre>\n\u9017\u53f7\u5728\u7c7b\u578b\u8f6c\u6362\u4e2d\u4e3b\u8981\u662f\u5143\u7ec4\u7684\u8f6c\u6362\uff0c\u53ea\u6709\u5f53\u5143\u7ec4\u4e2d\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u7684\u65f6\u5019\uff0c\u9700\u8981\u9017\u53f7\u6765\u8f6c\u6362\u4e3a\u5143\u7ec4\u7c7b\u578b\uff1a
\n\u5982\uff1ab=(11,) #b\u4e3a\u4e00\u4e2a\u5143\u7ec4\uff0c\u4e14\u5143\u7d20\u53ea\u6709\u4e00\u4e2a<\/p>\n
\u603b\u7ed3<\/strong><\/div>\n\u5230\u6b64\u8fd9\u7bc7\u5173\u4e8epython\u53d8\u91cf\u52a0\u9017\u53f7,\u7684\u542b\u4e49\u7684\u6587\u7ae0\u5c31\u4ecb\u7ecd\u5230\u8fd9\u4e86<\/p>\n","protected":false},"excerpt":{"rendered":"
>>> (1) 1 >>> (1,) (1,) >>> 1, (1,) >>> a=(1,) >>> b=a […]<\/p>\n","protected":false},"author":1893,"featured_media":173281,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-173278","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/173278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1893"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=173278"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/173278\/revisions"}],"predecessor-version":[{"id":173290,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/173278\/revisions\/173290"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/173281"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=173278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=173278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=173278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}