Skip to main content

Utilizing Python Loops

Hands-On Lab

 

Photo of Keith Thompson

Keith Thompson

DevOps Training Architect II in Content

Length

01:00:00

Difficulty

Beginner

One of the great strengths of computer programs is that they can process an incredible amount of information far faster than we could do it manually. To achieve this we need to be able to loop through collections and sequences. In this hands-on lab, we'll work through the popular interviewing Fizz-Buzz problem by creating a script that will prompt the user for the number of items to process, and then print out either the number, "Fizz", "Buzz", or "FizzBuzz" for each number between 1 and the user-provided number. To feel comfortable completing this lab you'll want to know how to do the following: Utilize for loops. Watch "The for Loop" video from the [Certified Entry-Level Python Programmer Certification][1] course. Nest conditionals and loops. Watch the "Nesting Loops and Conditionals" video from the [Certified Entry-Level Python Programmer Certification][1] course. * Utilize the range type. Watch "Using range" video from the [Certified Entry-Level Python Programmer Certification][1] course. [1]: https://linuxacademy.com/cp/modules/view/id/413

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.