Python Basics - Lesson 4 - FOR Loop, WHILE Loop and Conditional IF Statement HD
Lesson 4 in Python Basics by Ziyan Junaideen covers LOOPs and IF statements. Loops and If statements are commonly used programming skills that is easy to learn. In this video, initially we talk about WHILE LOOPS and FOR LOOPS in Python. WHILE LOOPs use a conditional statement to determine its boundaries while FOR LOOPs use an iterable data-structure like a List. When considering FOR LOOPS the range function ( range([start,] end [, increment]) ) comes handy as it generates an iterable list of values. When considering WHILE LOOPs, great care must be taken to guarantee the termination of the loop or would cause an infinite loop that could cause undesirable slowing down and effects. Then this video discusses how to handle conditional statements using IF statement. IF statements structure is as follows: if [condition] : Line 1 Line 2 else: Line 1 Line 2