Conditional Statements & Loops: Advanced Operations Using for Loops in Python

Python 3.0    |    Beginner
  • 9 Videos | 1h 9m 22s
  • Includes Assessment
  • Earns a Badge
Likes 260 Likes 260
Explore how iterating over elements using for loops can be controlled using the break and continue statements in Python. Creating sequences from other sequences using comprehensions is also covered in this 9-video course. Key concepts covered here include how to terminate a for loop when a specific condition is met using the break statement; learning how the break statement affects the code in the else block of a for loop; and observing how to skip an iteration of a for loop when a specific condition is met using the continue statement. Next, learn how to use the continue statement along with the break statement within the same for loop; learn the fact that no action is performed under specific conditions by using the pass statement; and create a list out of the contents of another list using a comprehension. Finally, you will learn about conditions in list comprehensions in order to filter elements used in the source list and to define values in the newly created list.

WHAT YOU WILL LEARN

  • discover the key concepts covered in this course
    terminate a for loop when a specific condition is met using the break statement
    recognize how the break statement affects the code in the else block of a for loop
    skip an iteration of a for loop when a specific condition is met using the continue statement
    use the continue statement along with the break statement within the same for loop
  • convey the fact that no action is performed under specific conditions by using the pass statement
    create a list out of the contents of another list using a comprehension
    specify conditions in list comprehensions in order to filter elements used in the source list and to define the values in the newly created list
    write for loops that make use of the break and continue statements to control flow and use comprehensions to generate a list

IN THIS COURSE

  • Playable
    1. 
    Course Overview
    2m 32s
    UP NEXT
  • Playable
    2. 
    Introducing the break Statement
    8m 33s
  • Locked
    3. 
    The break Statement and the else block
    8m 21s
  • Locked
    4. 
    The continue Statement: Part 1
    8m 26s
  • Locked
    5. 
    The continue Statement: Part 2
    6m 18s
  • Locked
    6. 
    The pass Statement
    8m 27s
  • Locked
    7. 
    Introducing Comprehensions
    9m 7s
  • Locked
    8. 
    Applying Conditions in Comprehensions
    9m
  • Locked
    9. 
    Exercise: Advanced Operations in for Loops
    5m 7s

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

Skillsoft is providing you the opportunity to earn a digital badge upon successful completion of this course, which can be shared on any social network or business platform

Digital badges are yours to keep, forever.

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE