diff --git a/Python/014_loops.py b/Python/014_loops.py index a07dcd7..1e48fe7 100644 --- a/Python/014_loops.py +++ b/Python/014_loops.py @@ -11,4 +11,20 @@ while number <= 10: print(f"Number: {number}") number = number + 1 +# The range(start, end) function returns +# numbers starting with "start" and ending +# one number before "end". +# range(0, 10) will return numbers from 0 to 9 + +# This is a "for" loop. For loops are used to +# iterate over lists or other collections of data. +# To iterate means to walk through a set of data +# one element at a time. A for loop lets you walk +# through a collection of data and do something +# with each element of that collection. +print("Numbers:", end='') +for num in range(0, 10): + print(f" {num}", end='') +print() + print() \ No newline at end of file