{"id":386,"date":"2025-04-16T08:48:45","date_gmt":"2025-04-16T08:48:45","guid":{"rendered":"https:\/\/ajnock.com\/?p=386"},"modified":"2025-04-16T08:48:45","modified_gmt":"2025-04-16T08:48:45","slug":"%e0%b9%80%e0%b8%a3%e0%b8%b4%e0%b9%88%e0%b8%a1%e0%b8%95%e0%b9%89%e0%b8%99%e0%b9%80%e0%b8%82%e0%b8%b5%e0%b8%a2%e0%b8%99%e0%b9%82%e0%b8%84%e0%b9%89%e0%b8%94%e0%b8%94%e0%b9%89%e0%b8%a7%e0%b8%a2-python","status":"publish","type":"post","link":"https:\/\/ajnock.com\/?p=386","title":{"rendered":"\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19\u0e40\u0e02\u0e35\u0e22\u0e19\u0e42\u0e04\u0e49\u0e14\u0e14\u0e49\u0e27\u0e22 Python \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e04\u0e19\u0e44\u0e21\u0e48\u0e40\u0e04\u0e22\u0e40\u0e02\u0e35\u0e22\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21"},"content":{"rendered":"\n<p><strong>\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e1e\u0e37\u0e49\u0e19\u0e10\u0e32\u0e19\u0e01\u0e32\u0e23\u0e40\u0e02\u0e35\u0e22\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e41\u0e1a\u0e1a\u0e40\u0e02\u0e49\u0e32\u0e43\u0e08\u0e07\u0e48\u0e32\u0e22 \u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e48\u0e04\u0e38\u0e13\u0e17\u0e33\u0e15\u0e32\u0e21\u0e44\u0e14\u0e49\u0e17\u0e31\u0e19\u0e17\u0e35<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0e17\u0e33\u0e44\u0e21\u0e15\u0e49\u0e2d\u0e07\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19\u0e14\u0e49\u0e27\u0e22 Python?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u0e2d\u0e48\u0e32\u0e19\u0e07\u0e48\u0e32\u0e22 \u0e43\u0e01\u0e25\u0e49\u0e40\u0e04\u0e35\u0e22\u0e07\u0e20\u0e32\u0e29\u0e32\u0e04\u0e19<\/strong> \u0e40\u0e0a\u0e48\u0e19 <code>print(\"Hello\")<\/code><\/li>\n\n\n\n<li><strong>\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e44\u0e14\u0e49\u0e2b\u0e25\u0e32\u0e01\u0e2b\u0e25\u0e32\u0e22<\/strong>: \u0e07\u0e32\u0e19\u0e27\u0e34\u0e40\u0e04\u0e23\u0e32\u0e30\u0e2b\u0e4c\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25, \u0e40\u0e27\u0e47\u0e1a\u0e44\u0e0b\u0e15\u0e4c, \u0e40\u0e01\u0e21, AI<\/li>\n\n\n\n<li><strong>\u0e21\u0e35\u0e0a\u0e38\u0e21\u0e0a\u0e19\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e40\u0e22\u0e2d\u0e30<\/strong> \u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e44\u0e14\u0e49\u0e07\u0e48\u0e32\u0e22 \u0e41\u0e25\u0e30\u0e2b\u0e32\u0e04\u0e33\u0e15\u0e2d\u0e1a\u0e44\u0e14\u0e49\u0e15\u0e25\u0e2d\u0e14\u0e40\u0e27\u0e25\u0e32<\/li>\n\n\n\n<li><strong>\u0e1f\u0e23\u0e35<\/strong> \u0e41\u0e25\u0e30\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e44\u0e14\u0e49\u0e17\u0e31\u0e49\u0e07\u0e1a\u0e19 Windows, macOS, Linux<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">STEP 1: \u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 Python<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u0e40\u0e02\u0e49\u0e32\u0e40\u0e27\u0e47\u0e1a\u0e44\u0e0b\u0e15\u0e4c <a class=\"\" href=\"https:\/\/www.python.org\/downloads\" target=\"_blank\" rel=\"noopener\">https:\/\/www.python.org\/downloads<\/a><\/li>\n\n\n\n<li>\u0e01\u0e14 \u201cDownload Python\u201d (\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e19\u0e25\u0e48\u0e32\u0e2a\u0e38\u0e14 \u0e40\u0e0a\u0e48\u0e19 3.12)<\/li>\n\n\n\n<li><strong>\u0e2a\u0e33\u0e04\u0e31\u0e0d!<\/strong> \u0e15\u0e2d\u0e19\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 \u0e43\u0e2b\u0e49\u0e15\u0e34\u0e4a\u0e01\u0e40\u0e25\u0e37\u0e2d\u0e01 \u201cAdd Python to PATH\u201d \u0e14\u0e49\u0e27\u0e22<\/li>\n\n\n\n<li>\u0e40\u0e2a\u0e23\u0e47\u0e08\u0e41\u0e25\u0e49\u0e27 \u0e40\u0e1b\u0e34\u0e14\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e17\u0e35\u0e48\u0e0a\u0e37\u0e48\u0e2d\u0e27\u0e48\u0e32 <strong>IDLE<\/strong> \u0e2b\u0e23\u0e37\u0e2d\u0e43\u0e0a\u0e49 <strong>Visual Studio Code<\/strong> \u0e01\u0e47\u0e44\u0e14\u0e49<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">STEP 2: \u0e40\u0e02\u0e35\u0e22\u0e19\u0e42\u0e04\u0e49\u0e14\u0e41\u0e23\u0e01\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13<\/h2>\n\n\n\n<p>\u0e40\u0e1b\u0e34\u0e14 IDLE \u0e2b\u0e23\u0e37\u0e2d VS Code \u0e41\u0e25\u0e49\u0e27\u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e42\u0e04\u0e49\u0e14\u0e19\u0e35\u0e49:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>print(\"\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35 Python!\")\n<\/code><\/code><\/pre>\n\n\n\n<p>\u0e01\u0e14\u0e23\u0e31\u0e19 (Run) \u0e2b\u0e23\u0e37\u0e2d\u0e01\u0e14 F5<br>\u0e04\u0e38\u0e13\u0e08\u0e30\u0e40\u0e2b\u0e47\u0e19\u0e04\u0e33\u0e27\u0e48\u0e32: <code>\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35 Python!<\/code> \u0e41\u0e2a\u0e14\u0e07\u0e1a\u0e19\u0e2b\u0e19\u0e49\u0e32\u0e08\u0e2d<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">STEP 3: \u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e1e\u0e37\u0e49\u0e19\u0e10\u0e32\u0e19 Python \u0e17\u0e35\u0e48\u0e04\u0e27\u0e23\u0e23\u0e39\u0e49<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23 (Variables)<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>name = \"\u0e2a\u0e21\u0e0a\u0e32\u0e22\"\nage = 25\nprint(name)\nprint(age)\n<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>\u0e01\u0e32\u0e23\u0e23\u0e31\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e08\u0e32\u0e01\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>name = input(\"\u0e0a\u0e37\u0e48\u0e2d\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13\u0e04\u0e37\u0e2d\u0e2d\u0e30\u0e44\u0e23: \")\nprint(\"\u0e22\u0e34\u0e19\u0e14\u0e35\u0e15\u0e49\u0e2d\u0e19\u0e23\u0e31\u0e1a, \" + name)\n<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>\u0e16\u0e49\u0e32\u2026\u0e17\u0e33\u0e2d\u0e30\u0e44\u0e23 (if\/else)<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>age = int(input(\"\u0e04\u0e38\u0e13\u0e2d\u0e32\u0e22\u0e38\u0e40\u0e17\u0e48\u0e32\u0e44\u0e23: \"))\nif age >= 18:\n    print(\"\u0e04\u0e38\u0e13\u0e1a\u0e23\u0e23\u0e25\u0e38\u0e19\u0e34\u0e15\u0e34\u0e20\u0e32\u0e27\u0e30\u0e41\u0e25\u0e49\u0e27\")\nelse:\n    print(\"\u0e04\u0e38\u0e13\u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e1a\u0e23\u0e23\u0e25\u0e38\u0e19\u0e34\u0e15\u0e34\u0e20\u0e32\u0e27\u0e30\")\n<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. <strong>\u0e01\u0e32\u0e23\u0e17\u0e33\u0e0b\u0e49\u0e33 (Loop)<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>for i in range(5):\n    print(\"\u0e23\u0e2d\u0e1a\u0e17\u0e35\u0e48\", i)\n<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">5. <strong>\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 (Function)<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>def say_hello():\n    print(\"\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35!\")\n\nsay_hello()\n<\/code><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">STEP 4: \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e40\u0e25\u0e47\u0e01\u0e46 \u0e07\u0e48\u0e32\u0e22\u0e46<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e04\u0e34\u0e14\u0e40\u0e25\u0e02\u0e07\u0e48\u0e32\u0e22\u0e46<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>a = int(input(\"\u0e01\u0e23\u0e2d\u0e01\u0e40\u0e25\u0e02\u0e15\u0e31\u0e27\u0e41\u0e23\u0e01: \"))\nb = int(input(\"\u0e01\u0e23\u0e2d\u0e01\u0e40\u0e25\u0e02\u0e15\u0e31\u0e27\u0e17\u0e35\u0e48\u0e2a\u0e2d\u0e07: \"))\nprint(\"\u0e1c\u0e25\u0e23\u0e27\u0e21\u0e04\u0e37\u0e2d\", a + b)\n<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u0e40\u0e01\u0e21\u0e17\u0e32\u0e22\u0e40\u0e25\u0e02 (Guess Number)<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><code>import random\nnumber = random.randint(1, 10)\nguess = int(input(\"\u0e17\u0e32\u0e22\u0e40\u0e25\u0e02 1-10: \"))\nif guess == number:\n    print(\"\u0e04\u0e38\u0e13\u0e17\u0e32\u0e22\u0e16\u0e39\u0e01!\")\nelse:\n    print(\"\u0e1c\u0e34\u0e14\u0e08\u0e49\u0e32 \u0e40\u0e25\u0e02\u0e17\u0e35\u0e48\u0e16\u0e39\u0e01\u0e04\u0e37\u0e2d\", number)\n<\/code><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">STEP 5: \u0e16\u0e49\u0e32\u0e04\u0e38\u0e13\u0e2d\u0e22\u0e32\u0e01\u0e40\u0e01\u0e48\u0e07\u0e02\u0e36\u0e49\u0e19 \u0e04\u0e27\u0e23\u0e17\u0e33\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e44\u0e23?<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u0e1d\u0e36\u0e01\u0e40\u0e02\u0e35\u0e22\u0e19\u0e17\u0e38\u0e01\u0e27\u0e31\u0e19<\/strong> \u0e27\u0e31\u0e19\u0e25\u0e30 10\u201315 \u0e19\u0e32\u0e17\u0e35<\/li>\n\n\n\n<li>\u0e40\u0e25\u0e48\u0e19\u0e40\u0e27\u0e47\u0e1a\u0e1d\u0e36\u0e01\u0e40\u0e02\u0e35\u0e22\u0e19\u0e42\u0e04\u0e49\u0e14 \u0e40\u0e0a\u0e48\u0e19\n<ul class=\"wp-block-list\">\n<li><a class=\"\" href=\"https:\/\/replit.com\" target=\"_blank\" rel=\"noopener\">https:\/\/replit.com<\/a><\/li>\n\n\n\n<li><a class=\"\">https:\/\/www.w3schools.com\/python<\/a><\/li>\n\n\n\n<li><a class=\"\" href=\"https:\/\/codewars.com\" target=\"_blank\" rel=\"noopener\">https:\/\/codewars.com<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u0e25\u0e2d\u0e07\u0e17\u0e33\u0e42\u0e1b\u0e23\u0e40\u0e08\u0e01\u0e15\u0e4c\u0e40\u0e25\u0e47\u0e01 \u0e46 \u0e40\u0e0a\u0e48\u0e19\n<ul class=\"wp-block-list\">\n<li>\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e04\u0e33\u0e19\u0e27\u0e13\u0e40\u0e01\u0e23\u0e14<\/li>\n\n\n\n<li>\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32\u0e08\u0e31\u0e1a\u0e40\u0e27\u0e25\u0e32<\/li>\n\n\n\n<li>\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d Google Sheet \u0e14\u0e49\u0e27\u0e22 Python<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0e2a\u0e23\u0e38\u0e1b\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e21\u0e37\u0e2d\u0e43\u0e2b\u0e21\u0e48<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u0e2b\u0e31\u0e27\u0e02\u0e49\u0e2d\u0e17\u0e35\u0e48\u0e04\u0e27\u0e23\u0e40\u0e23\u0e34\u0e48\u0e21\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49<\/th><th>\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e42\u0e04\u0e49\u0e14<\/th><\/tr><\/thead><tbody><tr><td>\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21<\/td><td><code>print(\"Hello\")<\/code><\/td><\/tr><tr><td>\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\u0e41\u0e25\u0e30\u0e1b\u0e23\u0e30\u0e40\u0e20\u0e17\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25<\/td><td><code>x = 10<\/code>, <code>name = \"John\"<\/code><\/td><\/tr><tr><td>\u0e16\u0e32\u0e21\u2013\u0e15\u0e2d\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49<\/td><td><code>input()<\/code><\/td><\/tr><tr><td>\u0e15\u0e31\u0e14\u0e2a\u0e34\u0e19\u0e43\u0e08 if\/else<\/td><td><code>if x &gt; 10:<\/code><\/td><\/tr><tr><td>\u0e27\u0e19\u0e25\u0e39\u0e1b for \/ while<\/td><td><code>for i in range(5):<\/code><\/td><\/tr><tr><td>\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19<\/td><td><code>def greet():<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e1e\u0e37\u0e49\u0e19\u0e10\u0e32\u0e19\u0e01\u0e32\u0e23\u0e40\u0e02\u0e35\u0e22\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e41\u0e1a\u0e1a\u0e40\u0e02\u0e49\u0e32\u0e43\u0e08\u0e07\u0e48\u0e32\u0e22 \u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,27,61],"tags":[62,64,63],"class_list":["post-386","post","type-post","status-publish","format-standard","hentry","category-computer-tips","category-freeware","category-programming","tag-python","tag-visual-studio-code","tag-vscode"],"_links":{"self":[{"href":"https:\/\/ajnock.com\/index.php?rest_route=\/wp\/v2\/posts\/386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ajnock.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ajnock.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ajnock.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ajnock.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=386"}],"version-history":[{"count":1,"href":"https:\/\/ajnock.com\/index.php?rest_route=\/wp\/v2\/posts\/386\/revisions"}],"predecessor-version":[{"id":387,"href":"https:\/\/ajnock.com\/index.php?rest_route=\/wp\/v2\/posts\/386\/revisions\/387"}],"wp:attachment":[{"href":"https:\/\/ajnock.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ajnock.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ajnock.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}