[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"academy-blogs-en-1-1-all-what-is-fizzbuzz-try-it-all--*":3,"academy-blog-translations-txuqw97zsjzjzb0":80},{"data":4,"page":79,"perPage":79,"totalItems":79,"totalPages":79},[5],{"alt":6,"collectionId":7,"collectionName":8,"content":9,"cover_image":10,"cover_image_path":11,"created":12,"created_by":13,"expand":14,"id":75,"keywords":76,"locale":49,"published_at":68,"scheduled_at":13,"school_blog":71,"short_description":77,"status":69,"title":6,"updated":78,"updated_by":13,"slug":72,"views":74},"What is FizzBuzz? Let's try it out!","sclblg987654321","school_blog_translations","\u003Ch2>\u003Cstrong>What is FizzBuzz?\u003C\u002Fstrong>\u003C\u002Fh2>\u003Cp>FizzBuzz is a programming problem that helps test the learner's coding skills, especially at the beginner level. It is often used in programmer job interviews to assess the understanding of the basic logic of coding.\u003C\u002Fp>\u003Ch3>\u003Cstrong>Importance of FizzBuzz\u003C\u002Fstrong>\u003C\u002Fh3>\u003Cul>\u003Cli>Skill training: Helps develop logical thinking and coding skills.\u003C\u002Fli>\u003Cli>Knowledge assessment: Often used in job interviews to assess the understanding of logic and programming.\u003C\u002Fli>\u003Cli>Conditional management: Helps learners understand the use of conditional statements (if-else) in coding.\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>\u003Cstrong>Today, SuperDev School brings easy FizzBuzz problems for programmers to try. Let's read the problems!\u003C\u002Fstrong>\u003C\u002Fp>\u003Ch3>\u003Cstrong>The problems are as follows! Don't peek at the answers below!\u003C\u002Fstrong>\u003C\u002Fh3>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cul>\u003Cli>Write a Python code to display a number from 1 to 100.\u003C\u002Fli>\u003Cli>But if the number is divisible by 3, display the word \"Fizz\".\u003C\u002Fli>\u003Cli>If the number is divisible by 5, display the word \"Buzz\".\u003C\u002Fli>\u003Cli>If the number is divisible by both 3 and 5, display the word \"FizzBuzz\".\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>\u003Cstrong>If anyone has done it, comment under the post!!\u003C\u002Fstrong>\u003C\u002Fp>\u003Cp>*\u003C\u002Fp>\u003Cp>*\u003C\u002Fp>\u003Cp>*\u003C\u002Fp>\u003Cp>*\u003C\u002Fp>\u003Cp>*\u003C\u002Fp>\u003Cp>*\u003C\u002Fp>\u003Ch3>\u003Cstrong>Solution\u003C\u002Fstrong>\u003C\u002Fh3>\u003Cul>\u003Cli>Explain FizzBuzz Problems\u003Cbr>The FizzBuzz problem asks you to write code to display a number from 1 to 100 with specific conditions:\u003C\u002Fli>\u003C\u002Ful>\u003Cp>If the number is divisible by 3 (e.g. 3, 6, 9, 12, etc.), display the word \"Fizz\" instead of the number.\u003C\u002Fp>\u003Cp>If the number is divisible by 5 (e.g. 5, 10, 15, 20, etc.), display the word \"Buzz\" instead of the number.\u003C\u002Fp>\u003Cp>If the number is divisible by both 3 and 5 (e.g. 15, 30, 45, etc.), display the word \"FizzBuzz\" instead of the number.\u003C\u002Fp>\u003Cp>If the number does not meet any of the conditions, display the number itself.\u003C\u002Fp>\u003Cp style=\"text-align:center;\">\u003Cstrong>Correct code&nbsp;\u003C\u002Fstrong>\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-python\">for i in range(1, 101):\r\n    if i % 3 == 0 and i % 5 == 0:\r\n        print(\"FizzBuzz\")\r\n    elif i % 3 == 0:\r\n        print(\"Fizz\")\r\n    elif i % 5 == 0:\r\n        print(\"Buzz\")\r\n    else:\r\n        print(i)\r\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>When this code is run, the result will be a number from 1 to 100, where some numbers will be replaced by \"Fizz\", \"Buzz\", or \"FizzBuzz\" depending on the conditions.\u003C\u002Fp>\u003Cp>- 1\u003Cbr>- 2\u003Cbr>- Fizz\u003Cbr>- 4\u003Cbr>- Buzz\u003Cbr>- Fizz\u003Cbr>- 7\u003Cbr>- 8\u003Cbr>- Fizz\u003Cbr>- Buzz\u003Cbr>- ...\u003Cbr>- FizzBuzz (at 15, 30, 45, 60, 75, 90)\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cul>\u003Cli>\u003Cstrong>Example of Wrong Code\u003C\u002Fstrong>\u003C\u002Fli>\u003C\u002Ful>\u003Cp style=\"text-align:center;\">\u003Cstrong>&nbsp;the wrong code\u003C\u002Fstrong>\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-python\">for i in range(1, 101):\r\n    if i % 3 == 0:\r\n        print(\"Fizz\")\r\n    elif i % 5 == 0:\r\n        print(\"Buzz\")\r\n    elif i % 3 == 0 and i % 5 == 0:\r\n        print(\"FizzBuzz\")\r\n    else:\r\n        print(i)\r\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>\u003Cstrong>Why is it wrong?\u003C\u002Fstrong>\u003C\u002Fp>\u003Cp>1. Order of conditions:\u003Cbr>- This code checks the conditions \"Fizz\" and \"Buzz\" before checking \"FizzBuzz\", which is incorrect.\u003Cbr>- According to the question, if the number is divisible by both 3 and 5, \"FizzBuzz\" should be displayed before checking the other conditions.\u003C\u002Fp>\u003Cp>2. Not displaying \"FizzBuzz\":\u003Cbr>- With the specified order, if the number i is 15 (which is divisible by both 3 and 5), the system will check the first condition (i % 3 == 0) and immediately display the word \"Fizz\", without checking the condition that is \"FizzBuzz\". The result will not be as expected.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Chr>\u003Cp>In conclusion, FizzBuzz is an easy but important problem for learning programming. It helps learners understand the use of logic and conditional statements better. Practicing this problem will help develop skills and confidence in writing code in the future! If you don't want to miss out on more great knowledge like this, don't forget to follow SuperDev School!\u003C\u002Fp>","2ukg9kb7e8i_yxqfgrbut7.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclblg987654321\u002F8wkz3wc16j0kw82\u002F2ukg9kb7e8i_yxqfgrbut7.webp","2026-03-04 08:32:31.167Z","",{"keywords":15,"locale":43,"school_blog":53},[16,23,28,33,38],{"collectionId":17,"collectionName":18,"created":19,"created_by":13,"id":20,"name":21,"updated":22,"updated_by":13},"sclkey987654321","school_keywords","2026-03-04 08:32:21.170Z","iq2nkm99wnynugj","Must Try!","2026-04-10 16:07:52.822Z",{"collectionId":17,"collectionName":18,"created":24,"created_by":13,"id":25,"name":26,"updated":27,"updated_by":13},"2026-03-04 08:32:22.725Z","6pldbj2uxt93zwe","Tips For Programmer","2026-04-10 16:07:53.264Z",{"collectionId":17,"collectionName":18,"created":29,"created_by":13,"id":30,"name":31,"updated":32,"updated_by":13},"2026-03-04 08:32:15.843Z","m0x7wo77i8iycf1","Programming Education","2026-04-10 16:07:51.675Z",{"collectionId":17,"collectionName":18,"created":34,"created_by":13,"id":35,"name":36,"updated":37,"updated_by":13},"2026-03-04 08:32:26.482Z","mkpx1fse1b4n2lo","FizzBuzz","2026-04-10 16:07:54.192Z",{"collectionId":17,"collectionName":18,"created":39,"created_by":13,"id":40,"name":41,"updated":42,"updated_by":13},"2026-03-04 08:32:19.158Z","bgg3nh0rvkdwziz","2025","2026-04-10 16:07:52.242Z",{"code":44,"collectionId":45,"collectionName":46,"created":47,"flag":48,"id":49,"is_default":50,"label":51,"updated":52},"en","pbc_1989393366","locales","2026-01-22 11:00:02.726Z","twemoji:flag-united-states","qv9c1llfov2d88z",false,"English","2026-04-10 15:42:46.825Z",{"category":54,"collectionId":55,"collectionName":56,"created":13,"expand":57,"id":71,"slug":72,"updated":73,"views":74},"o37wngr5r59sj2o","pbc_2105096300","school_blogs",{"category":58},{"blogIds":59,"collectionId":60,"collectionName":61,"created":62,"created_by":13,"id":54,"image":63,"image_alt":13,"image_path":64,"label":65,"name":66,"priority":67,"publish_at":68,"scheduled_at":13,"status":69,"updated":70,"updated_by":13},[],"sclcatblg987654321","school_category_blogs","2026-03-04 08:32:17.638Z","superdev_academy_ydt888goqf.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclcatblg987654321\u002Fo37wngr5r59sj2o\u002Fsuperdev_academy_ydt888goqf.webp",{"en":66,"th":66},"Superdev Academy",0,"2025-01-20 10:17:03.253Z","published","2026-04-25 02:32:15.211Z","txuqw97zsjzjzb0","what-is-fizzbuzz-try-it","2026-05-08 19:15:05.729Z",223,"8wkz3wc16j0kw82",[20,25,30,35,40],"This article introduces you to FizzBuzz, a programming challenge that tests your coding skills and understanding of logic, with easy-to-understand examples and solutions.","2026-04-25 02:47:25.650Z",1,{"th":72,"en":72}]