{"id":1461,"date":"2025-09-27T16:12:05","date_gmt":"2025-09-27T09:12:05","guid":{"rendered":"https:\/\/kienthucmo.com\/?p=1461"},"modified":"2026-03-26T11:51:30","modified_gmt":"2026-03-26T04:51:30","slug":"hoc-python-co-ban-lam-chu-vong-lap-while-chi-trong-10-phut","status":"publish","type":"post","link":"https:\/\/kienthucmo.com\/vi\/hoc-python-co-ban-lam-chu-vong-lap-while-chi-trong-10-phut\/","title":{"rendered":"H\u1ecdc Python c\u01a1 b\u1ea3n: L\u00e0m ch\u1ee7 v\u00f2ng l\u1eb7p while ch\u1ec9 trong 10 ph\u00fat"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Trong l\u1eadp tr\u00ecnh, v\u00f2ng l\u1eb7p l\u00e0 m\u1ed9t trong nh\u1eefng kh\u00e1i ni\u1ec7m c\u01a1 b\u1ea3n v\u00e0 quan tr\u1ecdng nh\u1ea5t. Nh\u1edd v\u00f2ng l\u1eb7p, ta c\u00f3 th\u1ec3 th\u1ef1c hi\u1ec7n l\u1eb7p \u0111i l\u1eb7p l\u1ea1i m\u1ed9t kh\u1ed1i l\u1ec7nh m\u00e0 kh\u00f4ng c\u1ea7n ph\u1ea3i vi\u1ebft th\u1ee7 c\u00f4ng nhi\u1ec1u l\u1ea7n. H\u00e3y th\u1eed t\u01b0\u1edfng t\u01b0\u1ee3ng b\u1ea1n mu\u1ed1n in ra c\u00e1c s\u1ed1 t\u1eeb 1 \u0111\u1ebfn 100. N\u1ebfu kh\u00f4ng c\u00f3 v\u00f2ng l\u1eb7p, b\u1ea1n s\u1ebd ph\u1ea3i vi\u1ebft \u0111\u1ebfn 100 d\u00f2ng l\u1ec7nh <code>print()<\/code>. Nh\u01b0ng v\u1edbi v\u00f2ng l\u1eb7p, ch\u1ec9 c\u1ea7n v\u00e0i d\u00f2ng code l\u00e0 xong.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Python cung c\u1ea5p hai lo\u1ea1i v\u00f2ng l\u1eb7p ch\u00ednh: <code>for<\/code> v\u00e0 <code>while<\/code>. N\u1ebfu nh\u01b0 <code>for<\/code> th\u01b0\u1eddng \u0111\u01b0\u1ee3c d\u00f9ng khi s\u1ed1 l\u1ea7n l\u1eb7p \u0111\u00e3 bi\u1ebft tr\u01b0\u1edbc, th\u00ec <code>while<\/code> l\u1ea1i t\u1ecfa s\u00e1ng trong nh\u1eefng t\u00ecnh hu\u1ed1ng m\u00e0 s\u1ed1 v\u00f2ng l\u1eb7p kh\u00f4ng x\u00e1c \u0111\u1ecbnh t\u1eeb \u0111\u1ea7u, ch\u1ec9 ph\u1ee5 thu\u1ed9c v\u00e0o m\u1ed9t \u0111i\u1ec1u ki\u1ec7n.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Trong b\u00e0i vi\u1ebft n\u00e0y, ch\u00fang ta s\u1ebd c\u00f9ng nhau t\u00ecm hi\u1ec3u v\u00f2ng l\u1eb7p <code>while<\/code> trong Python: c\u00fa ph\u00e1p, c\u00e1ch ho\u1ea1t \u0111\u1ed9ng, \u1ee9ng d\u1ee5ng th\u1ef1c t\u1ebf, c\u00e1c l\u1ec7nh \u0111i\u1ec1u khi\u1ec3n \u0111i k\u00e8m, nh\u1eefng l\u1ed7i th\u01b0\u1eddng g\u1eb7p v\u00e0 so s\u00e1nh v\u1edbi v\u00f2ng l\u1eb7p <code>for<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Kh\u00e1i ni\u1ec7m v\u1ec1 v\u00f2ng l\u1eb7p <code>while<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">V\u00f2ng l\u1eb7p <code>while<\/code> cho ph\u00e9p th\u1ef1c thi m\u1ed9t kh\u1ed1i l\u1ec7nh nhi\u1ec1u l\u1ea7n, mi\u1ec5n l\u00e0 \u0111i\u1ec1u ki\u1ec7n c\u00f2n \u0111\u00fang (<code>True<\/code>). Khi \u0111i\u1ec1u ki\u1ec7n tr\u1edf th\u00e0nh sai (<code>False<\/code>), v\u00f2ng l\u1eb7p s\u1ebd d\u1eebng.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>C\u00fa ph\u00e1p c\u01a1 b\u1ea3n:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>while \u0111i\u1ec1u_ki\u1ec7n:\n    # kh\u1ed1i l\u1ec7nh \u0111\u01b0\u1ee3c l\u1eb7p<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">while<\/span><span style=\"color: #D8DEE9FF\"> \u0111i\u1ec1u_ki\u1ec7n<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #616E88\"># kh\u1ed1i l\u1ec7nh \u0111\u01b0\u1ee3c l\u1eb7p<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">V\u00ed d\u1ee5 \u0111\u01a1n gi\u1ea3n: in ra c\u00e1c s\u1ed1 t\u1eeb 1 \u0111\u1ebfn 5.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>i = 1\nwhile i &lt;= 5:\n    print(i)\n    i += 1<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">i <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">while<\/span><span style=\"color: #D8DEE9FF\"> i <\/span><span style=\"color: #81A1C1\">&lt;=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">5<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">i<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    i <\/span><span style=\"color: #81A1C1\">+=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u1ede \u0111\u00e2y, bi\u1ebfn <code>i<\/code> \u0111\u00f3ng vai tr\u00f2 \u0111i\u1ec1u ki\u1ec7n d\u1eebng. N\u1ebfu kh\u00f4ng t\u0103ng <code>i<\/code> trong m\u1ed7i v\u00f2ng, ch\u01b0\u01a1ng tr\u00ecnh s\u1ebd ch\u1ea1y m\u00e3i kh\u00f4ng ng\u1eebng.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Lu\u1ed3ng ho\u1ea1t \u0111\u1ed9ng c\u1ee7a v\u00f2ng l\u1eb7p <code>while<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">C\u01a1 ch\u1ebf ho\u1ea1t \u0111\u1ed9ng c\u1ee7a v\u00f2ng l\u1eb7p <code>while<\/code> c\u00f3 th\u1ec3 t\u00f3m t\u1eaft nh\u01b0 sau:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Ki\u1ec3m tra \u0111i\u1ec1u ki\u1ec7n.<\/li>\n\n\n\n<li>N\u1ebfu \u0111i\u1ec1u ki\u1ec7n \u0111\u00fang (<code>True<\/code>) \u2192 th\u1ef1c hi\u1ec7n kh\u1ed1i l\u1ec7nh.<\/li>\n\n\n\n<li>Quay l\u1ea1i b\u01b0\u1edbc 1.<\/li>\n\n\n\n<li>N\u1ebfu \u0111i\u1ec1u ki\u1ec7n sai (<code>False<\/code>) \u2192 tho\u00e1t v\u00f2ng l\u1eb7p.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"600\" height=\"408\" src=\"https:\/\/kienthucmo.com\/wp-content\/uploads\/whilw-in-python.webp\" alt=\"\" class=\"wp-image-1462\" srcset=\"https:\/\/kienthucmo.com\/wp-content\/uploads\/whilw-in-python.webp 600w, https:\/\/kienthucmo.com\/wp-content\/uploads\/whilw-in-python-300x204.webp 300w, https:\/\/kienthucmo.com\/wp-content\/uploads\/whilw-in-python-250x170.webp 250w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">V\u00ed d\u1ee5 minh h\u1ecda:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>x = 3\nwhile x > 0:\n    print(\"Countdown:\", x)\n    x -= 1\nprint(\"Time's up!\")<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">x <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">3<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">while<\/span><span style=\"color: #D8DEE9FF\"> x <\/span><span style=\"color: #81A1C1\">&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Countdown:<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> x<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    x <\/span><span style=\"color: #81A1C1\">-=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Time&#39;s up!<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u1ede b\u01b0\u1edbc cu\u1ed1i c\u00f9ng, khi <code>x<\/code> gi\u1ea3m v\u1ec1 0, \u0111i\u1ec1u ki\u1ec7n <code>x &gt; 0<\/code> tr\u1edf th\u00e0nh <code>False<\/code>, v\u00f2ng l\u1eb7p d\u1eebng.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. C\u00e1c l\u1ec7nh \u0111i\u1ec1u khi\u1ec3n v\u00f2ng l\u1eb7p \u0111i k\u00e8m<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Python cung c\u1ea5p m\u1ed9t s\u1ed1 l\u1ec7nh \u0111\u1ec3 ki\u1ec3m so\u00e1t v\u00f2ng l\u1eb7p <code>while<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\ud83d\udd39 <code>break<\/code> \u2013 tho\u00e1t kh\u1ecfi v\u00f2ng l\u1eb7p ngay l\u1eadp t\u1ee9c<\/h4>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>i = 1\nwhile i &lt;= 10:\n    if i == 5:\n        break\n    print(i)\n    i += 1\n\n#results\n1 2 3 4<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">i <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">while<\/span><span style=\"color: #D8DEE9FF\"> i <\/span><span style=\"color: #81A1C1\">&lt;=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">10<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> i <\/span><span style=\"color: #81A1C1\">==<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">5<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">break<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">i<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    i <\/span><span style=\"color: #81A1C1\">+=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">#results<\/span><\/span>\n<span class=\"line\"><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">3<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">4<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\ud83d\udd39 <code>continue<\/code> \u2013 b\u1ecf qua l\u1ea7n l\u1eb7p hi\u1ec7n t\u1ea1i<\/h4>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>i = 0\nwhile i &lt; 5:\n    i += 1\n    if i == 3:\n        continue\n    print(i)\n\n#results\n1 2 4 5<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">i <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">while<\/span><span style=\"color: #D8DEE9FF\"> i <\/span><span style=\"color: #81A1C1\">&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">5<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    i <\/span><span style=\"color: #81A1C1\">+=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> i <\/span><span style=\"color: #81A1C1\">==<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">3<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">continue<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">i<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">#results<\/span><\/span>\n<span class=\"line\"><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">4<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">5<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\ud83d\udd39 <code>else<\/code> trong v\u00f2ng l\u1eb7p <code>while<\/code><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Python c\u00f3 m\u1ed9t t\u00ednh n\u0103ng \u0111\u1eb7c bi\u1ec7t: v\u00f2ng l\u1eb7p c\u00f3 th\u1ec3 \u0111i k\u00e8m <code>else<\/code>. Kh\u1ed1i <code>else<\/code> s\u1ebd ch\u1ea1y khi v\u00f2ng l\u1eb7p k\u1ebft th\u00fac m\u1ed9t c\u00e1ch t\u1ef1 nhi\u00ean, kh\u00f4ng b\u1ecb <code>break<\/code>.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>i = 1\nwhile i &lt; 4:\n    print(i)\n    i += 1\nelse:\n    print(\"End...!!!\")\n\n\n#result\n1 2 3 End...!!!\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">i <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">while<\/span><span style=\"color: #D8DEE9FF\"> i <\/span><span style=\"color: #81A1C1\">&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">4<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">i<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    i <\/span><span style=\"color: #81A1C1\">+=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">else<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">End...!!!<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">#result<\/span><\/span>\n<span class=\"line\"><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">3<\/span><span style=\"color: #D8DEE9FF\"> End...!!!<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">4. So s\u00e1nh <code>while<\/code> v\u1edbi <code>for<\/code> trong Python<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>for<\/code><\/strong>: th\u00edch h\u1ee3p khi <strong>bi\u1ebft tr\u01b0\u1edbc s\u1ed1 l\u1ea7n l\u1eb7p<\/strong>.<\/li>\n\n\n\n<li><strong><code>while<\/code><\/strong>: th\u00edch h\u1ee3p khi <strong>ch\u1ec9 bi\u1ebft \u0111i\u1ec1u ki\u1ec7n d\u1eebng<\/strong>, kh\u00f4ng x\u00e1c \u0111\u1ecbnh s\u1ed1 l\u1ea7n.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">V\u00ed d\u1ee5 in ra s\u1ed1 t\u1eeb 1 \u0111\u1ebfn 10:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># for\nfor i in range(1, 11):\n    print(i)\n\n# while\ni = 1\nwhile i &lt;= 10:\n    print(i)\n    i += 1\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #616E88\"># for<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">for<\/span><span style=\"color: #D8DEE9FF\"> i <\/span><span style=\"color: #81A1C1\">in<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">range<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">11<\/span><span style=\"color: #ECEFF4\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">i<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># while<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">i <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">while<\/span><span style=\"color: #D8DEE9FF\"> i <\/span><span style=\"color: #81A1C1\">&lt;=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">10<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">i<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    i <\/span><span style=\"color: #81A1C1\">+=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>L\u1eddi khuy\u00ean<\/strong>: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ch\u1ecdn <strong><code>for<\/code> <\/strong>khi duy\u1ec7t qua d\u00e3y s\u1ed1, danh s\u00e1ch; <\/li>\n\n\n\n<li>Ch\u1ecdn <strong><code>while<\/code> <\/strong>khi l\u00e0m vi\u1ec7c v\u1edbi \u0111i\u1ec1u ki\u1ec7n \u0111\u1ed9ng.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">5. K\u1ebft lu\u1eadn<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">V\u00f2ng l\u1eb7p <code>while<\/code> l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 m\u1ea1nh m\u1ebd trong Python, gi\u00fap x\u1eed l\u00fd nh\u1eefng t\u00ecnh hu\u1ed1ng m\u00e0 s\u1ed1 v\u00f2ng l\u1eb7p ch\u01b0a x\u00e1c \u0111\u1ecbnh tr\u01b0\u1edbc. Vi\u1ec7c n\u1eafm v\u1eefng c\u00e1ch s\u1eed d\u1ee5ng <code>while<\/code>, k\u1ebft h\u1ee3p v\u1edbi <code>break<\/code>, <code>continue<\/code>, v\u00e0 <code>else<\/code>, s\u1ebd gi\u00fap b\u1ea1n vi\u1ebft \u0111\u01b0\u1ee3c c\u00e1c ch\u01b0\u01a1ng tr\u00ecnh linh ho\u1ea1t v\u00e0 hi\u1ec7u qu\u1ea3 h\u01a1n.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Tuy nhi\u00ean, h\u00e3y lu\u00f4n c\u1ea9n th\u1eadn v\u1edbi c\u00e1c v\u00f2ng l\u1eb7p v\u00f4 h\u1ea1n. H\u00e3y ch\u1eafc ch\u1eafn r\u1eb1ng \u0111i\u1ec1u ki\u1ec7n l\u1eb7p s\u1ebd thay \u0111\u1ed5i v\u00e0 cu\u1ed1i c\u00f9ng tr\u1edf th\u00e0nh <code>False<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">L\u1eddi khuy\u00ean: luy\u1ec7n t\u1eadp b\u1eb1ng nh\u1eefng v\u00ed d\u1ee5 nh\u1ecf, sau \u0111\u00f3 \u00e1p d\u1ee5ng v\u00e0o c\u00e1c b\u00e0i to\u00e1n th\u1ef1c t\u1ebf nh\u01b0 x\u1eed l\u00fd nh\u1eadp d\u1eef li\u1ec7u, vi\u1ebft game \u0111\u01a1n gi\u1ea3n, ho\u1eb7c x\u00e2y d\u1ef1ng menu ch\u01b0\u01a1ng tr\u00ecnh.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6. T\u00e0i li\u1ec7u tham kh\u1ea3o<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Python Official Documentation: <a>https:\/\/docs.python.org\/3\/tutorial\/controlflow.html#while-statements<\/a><\/li>\n\n\n\n<li>W3Schools: <a>https:\/\/www.w3schools.com\/python\/python_while_loops.asp<\/a><\/li>\n\n\n\n<li>Real Python: <a>https:\/\/realpython.com\/python-while-loop\/<\/a><\/li>\n\n\n\n<li>Python for Professionals: Learning Python as a Second Language: <a href=\"https:\/\/click.linksynergy.com\/link?id=*C\/UgjGtUZ8&amp;offerid=1562891.3721710002222624882405978&amp;type=15&amp;murl=https%3A%2F%2Fwww.kobo.com%2Fus%2Fen%2Febook%2Fpython-for-professionals-3\" target=\"_blank\" rel=\"noopener\">https:\/\/www.kobo.com\/us\/en\/ebook\/python-for-professionals-3<\/a><\/li>\n\n\n\n<li>Python: Deeper Insights into Machine Learning: <a href=\"https:\/\/click.linksynergy.com\/link?id=*C\/UgjGtUZ8&amp;offerid=1562891.3721710015810095319857183&amp;type=15&amp;murl=https%3A%2F%2Fwww.kobo.com%2Fus%2Fen%2Febook%2Fpython-deeper-insights-into-machine-learning\" target=\"_blank\" rel=\"noopener\">https:\/\/www.kobo.com\/us\/en\/ebook\/python-deeper-insights-into-machine-learning<\/a><\/li>\n\n\n\n<li>DataFusion Python Bindings in Practice: The Complete Guide for Developers and Engineers: <a href=\"https:\/\/click.linksynergy.com\/link?id=*C\/UgjGtUZ8&amp;offerid=1562891.3721710049093362364820452&amp;type=15&amp;murl=https%3A%2F%2Fwww.kobo.com%2Fus%2Fen%2Febook%2Fdatafusion-python-bindings-in-practice\" target=\"_blank\" rel=\"noopener\">https:\/\/www.kobo.com\/us\/en\/ebook\/datafusion-python-bindings-in-practice<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>V\u00f2ng l\u1eb7p while l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 m\u1ea1nh m\u1ebd trong Python, gi\u00fap x\u1eed l\u00fd nh\u1eefng t\u00ecnh hu\u1ed1ng m\u00e0 s\u1ed1 v\u00f2ng l\u1eb7p ch\u01b0a x\u00e1c \u0111\u1ecbnh tr\u01b0\u1edbc. Vi\u1ec7c n\u1eafm v\u1eefng c\u00e1ch s\u1eed d\u1ee5ng while, k\u1ebft h\u1ee3p v\u1edbi break, continue, v\u00e0 else, s\u1ebd gi\u00fap b\u1ea1n vi\u1ebft \u0111\u01b0\u1ee3c c\u00e1c ch\u01b0\u01a1ng tr\u00ecnh linh ho\u1ea1t v\u00e0 hi\u1ec7u qu\u1ea3 h\u01a1n.<\/p>\n","protected":false},"author":1,"featured_media":3802,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAowieHDDA:productID":"","footnotes":""},"categories":[41],"tags":[40],"class_list":["post-1461","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kien-thuc-lap-trinh","tag-python-co-ban"],"_links":{"self":[{"href":"https:\/\/kienthucmo.com\/vi\/wp-json\/wp\/v2\/posts\/1461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kienthucmo.com\/vi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kienthucmo.com\/vi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kienthucmo.com\/vi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kienthucmo.com\/vi\/wp-json\/wp\/v2\/comments?post=1461"}],"version-history":[{"count":4,"href":"https:\/\/kienthucmo.com\/vi\/wp-json\/wp\/v2\/posts\/1461\/revisions"}],"predecessor-version":[{"id":3798,"href":"https:\/\/kienthucmo.com\/vi\/wp-json\/wp\/v2\/posts\/1461\/revisions\/3798"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kienthucmo.com\/vi\/wp-json\/wp\/v2\/media\/3802"}],"wp:attachment":[{"href":"https:\/\/kienthucmo.com\/vi\/wp-json\/wp\/v2\/media?parent=1461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kienthucmo.com\/vi\/wp-json\/wp\/v2\/categories?post=1461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kienthucmo.com\/vi\/wp-json\/wp\/v2\/tags?post=1461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}