{"id":65213,"date":"2022-11-25T21:19:20","date_gmt":"2022-11-25T18:19:20","guid":{"rendered":"https:\/\/mob25.com\/?p=65213"},"modified":"2022-11-25T21:19:23","modified_gmt":"2022-11-25T18:19:23","slug":"faktorial","status":"publish","type":"post","link":"https:\/\/mob25.com\/blog\/faktorial\/","title":{"rendered":"\u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b"},"content":{"rendered":"\n<p>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0447\u0438\u0441\u043b\u0430.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">n = int(input())\n\n# \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b (!) \u0447\u0438\u0441\u043b\u0430 - \u044d\u0442\u043e\n# \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0445\n# \u0447\u0438\u0441\u043b\u0435\u043b \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e.\n# \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 4! = 1 * 2 * 3 * 4 = 24.\n\n# \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f\n# \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.\nfactorial = 1\n\n# \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u0435\u043d\u0435\u043d\u0438\u0438\n# \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u0446\u0438\u043a\u043b\u0430 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435\n# \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043a\u043e\u043d\u0446\u0430,\n# \u0442. \u0435. \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0440\u044f\u0434\u0430.\n# \u0426\u0438\u043a\u043b \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440 \u043f\u043e\u043a\u0430\n# n \u043d\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u0441\u044f \u0434\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u044b.\nwhile n > 1:\n    factorial *= n\n    n -= 1\n\nprint(factorial)<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><span itemprop=\"image\" itemscope itemtype=\"https:\/\/schema.org\/ImageObject\"><img itemprop=\"url image\" loading=\"lazy\" decoding=\"async\" width=\"623\" height=\"509\" src=\"https:\/\/mob25.com\/wp-content\/uploads\/2022\/11\/faktorial.jpg\" alt=\"\" class=\"wp-image-65214\" srcset=\"https:\/\/mob25.com\/blog\/wp-content\/uploads\/2022\/11\/faktorial.jpg 623w, https:\/\/mob25.com\/blog\/wp-content\/uploads\/2022\/11\/faktorial-300x245.jpg 300w\" sizes=\"auto, (max-width: 623px) 100vw, 623px\" \/><meta itemprop=\"width\" content=\"623\"><meta itemprop=\"height\" content=\"509\"><\/span><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0447\u0438\u0441\u043b\u0430.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-65213","post","type-post","status-publish","format-standard","","category-zadachi-po-python-s-resheniyami"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0417\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 Python<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mob25.com\/blog\/faktorial\/\" \/>\n<meta property=\"og:locale\" content=\"ru_RU\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0417\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 Python\" \/>\n<meta property=\"og:description\" content=\"\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0447\u0438\u0441\u043b\u0430.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mob25.com\/blog\/faktorial\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-25T18:19:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-25T18:19:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mob25.com\/wp-content\/uploads\/2022\/11\/faktorial.jpg\" \/>\n<meta name=\"author\" content=\"mob25\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/mob25.com\/blog\/faktorial\/\",\"url\":\"https:\/\/mob25.com\/blog\/faktorial\/\",\"name\":\"\u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0417\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 Python\",\"isPartOf\":{\"@id\":\"https:\/\/mob25.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/mob25.com\/blog\/faktorial\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/mob25.com\/blog\/faktorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/mob25.com\/wp-content\/uploads\/2022\/11\/faktorial.jpg\",\"datePublished\":\"2022-11-25T18:19:20+00:00\",\"dateModified\":\"2022-11-25T18:19:23+00:00\",\"author\":{\"@id\":\"https:\/\/mob25.com\/blog\/#\/schema\/person\/b0d0c762a30795904061f383c6401489\"},\"breadcrumb\":{\"@id\":\"https:\/\/mob25.com\/blog\/faktorial\/#breadcrumb\"},\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/mob25.com\/blog\/faktorial\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\/\/mob25.com\/blog\/faktorial\/#primaryimage\",\"url\":\"https:\/\/mob25.com\/wp-content\/uploads\/2022\/11\/faktorial.jpg\",\"contentUrl\":\"https:\/\/mob25.com\/wp-content\/uploads\/2022\/11\/faktorial.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/mob25.com\/blog\/faktorial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\",\"item\":\"https:\/\/mob25.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/mob25.com\/blog\/#website\",\"url\":\"https:\/\/mob25.com\/blog\/\",\"name\":\"\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/mob25.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ru-RU\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/mob25.com\/blog\/#\/schema\/person\/b0d0c762a30795904061f383c6401489\",\"name\":\"mob25\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\/\/mob25.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/05dedffa125e5e4b26ae62cae4b744be451eb149ece723607015970ac71dda28?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/05dedffa125e5e4b26ae62cae4b744be451eb149ece723607015970ac71dda28?s=96&d=mm&r=g\",\"caption\":\"mob25\"},\"sameAs\":[\"https:\/\/mob25.com\"],\"url\":\"https:\/\/mob25.com\/blog\/author\/mob25\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0417\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 Python","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:\/\/mob25.com\/blog\/faktorial\/","og_locale":"ru_RU","og_type":"article","og_title":"\u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0417\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 Python","og_description":"\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0447\u0438\u0441\u043b\u0430.","og_url":"https:\/\/mob25.com\/blog\/faktorial\/","og_site_name":"\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438","article_published_time":"2022-11-25T18:19:20+00:00","article_modified_time":"2022-11-25T18:19:23+00:00","og_image":[{"url":"https:\/\/mob25.com\/wp-content\/uploads\/2022\/11\/faktorial.jpg","type":"","width":"","height":""}],"author":"mob25","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/mob25.com\/blog\/faktorial\/","url":"https:\/\/mob25.com\/blog\/faktorial\/","name":"\u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0417\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 Python","isPartOf":{"@id":"https:\/\/mob25.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mob25.com\/blog\/faktorial\/#primaryimage"},"image":{"@id":"https:\/\/mob25.com\/blog\/faktorial\/#primaryimage"},"thumbnailUrl":"https:\/\/mob25.com\/wp-content\/uploads\/2022\/11\/faktorial.jpg","datePublished":"2022-11-25T18:19:20+00:00","dateModified":"2022-11-25T18:19:23+00:00","author":{"@id":"https:\/\/mob25.com\/blog\/#\/schema\/person\/b0d0c762a30795904061f383c6401489"},"breadcrumb":{"@id":"https:\/\/mob25.com\/blog\/faktorial\/#breadcrumb"},"inLanguage":"ru-RU","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mob25.com\/blog\/faktorial\/"]}]},{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/mob25.com\/blog\/faktorial\/#primaryimage","url":"https:\/\/mob25.com\/wp-content\/uploads\/2022\/11\/faktorial.jpg","contentUrl":"https:\/\/mob25.com\/wp-content\/uploads\/2022\/11\/faktorial.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/mob25.com\/blog\/faktorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430","item":"https:\/\/mob25.com\/blog\/"},{"@type":"ListItem","position":2,"name":"\u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b"}]},{"@type":"WebSite","@id":"https:\/\/mob25.com\/blog\/#website","url":"https:\/\/mob25.com\/blog\/","name":"\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mob25.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ru-RU"},{"@type":"Person","@id":"https:\/\/mob25.com\/blog\/#\/schema\/person\/b0d0c762a30795904061f383c6401489","name":"mob25","image":{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/mob25.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/05dedffa125e5e4b26ae62cae4b744be451eb149ece723607015970ac71dda28?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/05dedffa125e5e4b26ae62cae4b744be451eb149ece723607015970ac71dda28?s=96&d=mm&r=g","caption":"mob25"},"sameAs":["https:\/\/mob25.com"],"url":"https:\/\/mob25.com\/blog\/author\/mob25\/"}]}},"_links":{"self":[{"href":"https:\/\/mob25.com\/blog\/wp-json\/wp\/v2\/posts\/65213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mob25.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mob25.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mob25.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mob25.com\/blog\/wp-json\/wp\/v2\/comments?post=65213"}],"version-history":[{"count":0,"href":"https:\/\/mob25.com\/blog\/wp-json\/wp\/v2\/posts\/65213\/revisions"}],"wp:attachment":[{"href":"https:\/\/mob25.com\/blog\/wp-json\/wp\/v2\/media?parent=65213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mob25.com\/blog\/wp-json\/wp\/v2\/categories?post=65213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mob25.com\/blog\/wp-json\/wp\/v2\/tags?post=65213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}