Python Introduction

Diplay Text on the Screen

If you have taken any programming language class before, you surely are familiar with the Hello World program. Almost every programming language course begins with this program. We will do the same because it is simple to understand and easy to code. This simple program teaches us the process of displaying text on the computer screen.


print("Using print function to display text on the screen.")
    

For Loop

For loop is used to iterate through some iterable python elements. It is important to learn the concepts of for loop. Along with for loop we must also learn about the range() function as it is frequently used along the for loop.

Range function

Range function usually takes an interger as parameter e.g. range(5). Here the integer number 5 represents a range of five numbers starting from 0 and ending at 4.

Suppose, you want to print the numbers 0 through 9. You can easily do it using for loop and range function. Just write the simple two line of codes given below.


for i in range(10):
    print(i)
    
The range(10) function is creating a list of numbers from 0 to 9 and variable i is iterating through them.