{"id":1422,"date":"2018-01-15T23:22:47","date_gmt":"2018-01-15T14:22:47","guid":{"rendered":"http:\/\/www.python.ambitious-engineer.com\/?p=1422"},"modified":"2018-01-15T23:22:47","modified_gmt":"2018-01-15T14:22:47","slug":"%e6%95%b0%e5%ad%a6%e7%b3%bb%e3%81%ae%e7%b5%84%e3%81%bf%e8%be%bc%e3%81%bf%e9%96%a2%e6%95%b0","status":"publish","type":"post","link":"https:\/\/www.python.ambitious-engineer.com\/archives\/1422","title":{"rendered":"\u6570\u5b66\u7cfb\u306e\u7d44\u307f\u8fbc\u307f\u95a2\u6570"},"content":{"rendered":"<p>\u3053\u306e\u30da\u30fc\u30b8\u3067\u306f\u3001\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u306e\u3046\u3061\u8a08\u7b97\u306b\u4f7f\u7528\u3067\u304d\u308b\u3082\u306e\u3092\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h2>sum() \u5408\u8a08\u3092\u6c42\u3081\u308b<\/h2>\n<p>sum\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3068\u30ea\u30b9\u30c8\u3084\u96c6\u5408\u306a\u3069\u306e\u30a4\u30c6\u30e9\u30d6\u30eb\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u8981\u7d20\u306e\u5408\u8a08\u5024\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b5\u30f3\u30d7\u30eb\u306f\u3001\u6570\u5024\u3092\u8981\u7d20\u3068\u3059\u308b\u30ea\u30b9\u30c8\u3068set\u306e\u5408\u8a08\u3092\u7b97\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nl = [1, 2, 3]\r\ns1 = sum(l)\r\nprint(s1) # 6\r\n\r\ns = {4, 5, 7}\r\ns2 = sum(s)\r\nprint(s2) # 16\r\n\r\n<\/pre>\n<h2>abs() \u7d76\u5bfe\u5024\u3092\u6c42\u3081\u308b<\/h2>\n<p>abs\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3068\u5f15\u6570\u3067\u6307\u5b9a\u3057\u305f\u6570\u5024\u306e\u7d76\u5bfe\u5024\u3092\u6c42\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u5f15\u6570\u306b\u8907\u7d20\u6570\u304c\u6307\u5b9a\u3055\u308c\u305f\u5834\u5408\u3001\u8907\u7d20\u6570\u306e\u7d76\u5bfe\u5024\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nabs(100)\r\n# 100\r\n\r\nabs(-99)\r\n# 99\r\n\r\nabs(1j + 3)\r\n# 3.1622776601683795\r\n\r\n<\/pre>\n<h2>max()\/ min() \u6700\u5927\u5024\/ \u6700\u5c0f\u5024\u3092\u6c42\u3081\u308b<\/h2>\n<p>max()\u3001min()\u306f\u3001\u30ea\u30b9\u30c8\u3084\u96c6\u5408\u306a\u3069\u306e\u30a4\u30c6\u30e9\u30d6\u30eb\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u8981\u7d20\u306e\u6700\u5927\u5024\u3001\u6700\u5c0f\u5024\u3092\u8a08\u7b97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b5\u30f3\u30d7\u30eb\u306f\u3001\u6570\u5024\u3092\u8981\u7d20\u3068\u3059\u308b\u30ea\u30b9\u30c8\u306e\u6700\u5927\u5024\u3068set\u306e\u6700\u5c0f\u5024\u3092\u7b97\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nl = [1, 2, 3]\r\nm1 = max(l)\r\nprint(m1) # 3\r\n\r\ns = {4, 5, 7}\r\nm2 = min(s)\r\nprint(m2) # 4\r\n\r\n<\/pre>\n<h2>pow() \u3079\u304d\u4e57\u8a08\u7b97\u3092\u304a\u3053\u306a\u3046<\/h2>\n<p>pow\u95a2\u6570\u3067\u3079\u304d\u4e57\u8a08\u7b97\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b5\u30f3\u30d7\u30eb\u306f2\u306e3\u4e57\u3092\u8a08\u7b97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\np = pow(2, 3)\r\nprint(p)  # 8\r\n\r\n<\/pre>\n<p>2 ** 3\u3068\u540c\u7b49\u306a\u306e\u3067\u3059\u304c\u3001\u95a2\u6570\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u5f15\u6570\u306a\u3069\u306b\u6e21\u3057\u305f\u308a\u3057\u3066\u6271\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>round() \u4e38\u3081\u308b<\/h2>\n<p>round\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u5f15\u6570\u306b\u4e38\u3081\u308b\u5bfe\u8c61\u306e\u6570\u5024\u3068\u3001\u4e38\u3081\u308b\u6841\u6570\u3092\u6307\u5b9a\u3057\u3066\u6700\u3082\u8fd1\u3044\u5024\u306b\u4e38\u3081\u305f\u6570\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u4e38\u3081\u308b\u6841\u6570\u3092\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u6574\u6570\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u305d\u308c\u305e\u308c\u5c0f\u6570\u70b9\u4ee5\u4e0b2\u6841\u30014\u6841\u30010\u6841\uff08\u6307\u5b9a\u306a\u3057\uff09\u3067\u4e38\u3081\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nr1 = round(3.14159, 2)\r\nprint(r1)  # 3.14\r\n\r\nr2 = round(3.14159, 4)\r\nprint(r2)  # 3.1416\r\n\r\nr3 = round(3.14159)\r\nprint(r3)  # 3\r\n\r\n<\/pre>\n<h2>N\u9032\u6570\u306b\u5909\u63db\u3059\u308b<\/h2>\n<p>2\u30018\u300116\u9032\u6570\u3068\u3044\u3063\u305f\u3088\u304f\u4f7f\u3046N\u9032\u6570\u306b\u306f\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u3067\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>bin() 2\u9032\u6570\u306b\u5909\u63db\u3059\u308b<\/h3>\n<p>bin\u95a2\u6570\u306f\u5f15\u6570\u3067\u6307\u5b9a\u3057\u305f\u6574\u6570\u30922\u9032\u6570\u306b\u5909\u63db\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nb1 = bin(255)\r\nprint(b1)  # '0b11111111'\r\n\r\nb2 = bin(256)\r\nprint(b2)  # '0b100000000'\r\n\r\n<\/pre>\n<h3>oct() 8\u9032\u6570\u306b\u5909\u63db\u3059\u308b<\/h3>\n<p>oct\u95a2\u6570\u306f\u5f15\u6570\u3067\u6307\u5b9a\u3057\u305f\u6574\u6570\u30928\u9032\u6570\u306b\u5909\u63db\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\no1 = oct(255)\r\nprint(o1)  # '0o377'\r\n\r\no2 = oct(256)\r\nprint(o2)  # '0o400'\r\n\r\n<\/pre>\n<h3>hex() 16\u9032\u6570\u306b\u5909\u63db\u3059\u308b<\/h3>\n<p>hex\u95a2\u6570\u306f\u5f15\u6570\u3067\u6307\u5b9a\u3057\u305f\u6574\u6570\u309216\u9032\u6570\u306b\u5909\u63db\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nh1 = hex(255)\r\nprint(h1)  # '0xff'\r\n\r\nh2 = hex(256)\r\nprint(h2)  # '0x100'\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u30da\u30fc\u30b8\u3067\u306f\u3001\u7d44\u307f\u8fbc\u307f\u95a2\u6570\u306e\u3046\u3061\u8a08\u7b97\u306b\u4f7f\u7528\u3067\u304d\u308b\u3082\u306e\u3092\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3057\u307e\u3059\u3002 sum() \u5408\u8a08\u3092\u6c42\u3081\u308b sum\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3068\u30ea\u30b9\u30c8\u3084\u96c6\u5408\u306a\u3069\u306e\u30a4\u30c6\u30e9\u30d6\u30eb\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u8981\u7d20\u306e\u5408\u8a08\u5024\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b5\u30f3\u30d7\u30eb\u306f\u3001\u6570\u5024\u3092...<\/p>\n","protected":false},"author":1,"featured_media":3593,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[136],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/1422"}],"collection":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/comments?post=1422"}],"version-history":[{"count":5,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/1422\/revisions"}],"predecessor-version":[{"id":3592,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/1422\/revisions\/3592"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/media\/3593"}],"wp:attachment":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/media?parent=1422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/categories?post=1422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/tags?post=1422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}