Intro to Computer Science Module 05 - Repetition (For and While Loops)

preview_player
Показать описание

In this module we are looking at how we can repeat sections of code as needed. For this, we commonly use a loop. Loops can be broken down into two main types, conditional loops (the while loop) and counting loops (the for loop). We'll look at these in Python breaking down how to move through lists of data.
We'll also look at data validation using a loop, and the creation of sentinel loops to allow a user to run a file for a long as they need.

Table of Contents:

00:00 - Introduction
02:22 - Two Different Looping Structures
02:46 - Conditional Loops
03:12 - Conditional Loops
03:30 - Setting Your Condition
05:15 - Trouble Shooting a While Loop
05:44 - Stepping Through the Code
06:39 - Defining an Infinite Loop
08:41 - Incrementer Shortcut
10:26 - Counting Down with a While Loop
11:33 - User Input on Loops with Boolean Values
16:59 - Boolean Logic in a While Condition
20:14 - While Loop as a Pre Test Loop
21:32 - A Sentinel Loop
22:24 - A Counting Loop
22:48 - For Loop
22:59 - List Basics
24:03 - Counting vs Conditional Loops
25:44 - Replacing a List with a Count of Element
26:58 - Optional Parameters for Range
30:01 - Skipping Numbers in a List
32:25 - For Loop with a List of Strings
34:37 - Data Validation Using a Conditional Loop
41:51 - Conclusion
Рекомендации по теме