Friday 21 August 2020

Lesson One

 

Without any further ado, let us begin. First lets open Python 3 that you installed recently. It should be there on the start button in Windows or you could just search for Python 3.

This is what the screen would look like.

Now, let us write the first program, ‘HELLO WORLD!’

At the prompt type and press the enter key

print(‘HELLO WORLD’)

You should get an output like this

That is it. CONGRATULATIONS!! You have written your first piece of code.

What you printed up there is known as a String and that is why it was enclosed between 2 qouation marks. If it was a number you would not use the quotation marks. We would define what strings are and also the different types of numbers later in the course.

Let us try more code. Type the following and press enter after each entry

                print(3)

                print(5)

                print(3 + 5)

You should get this on the screen

You can go ahead and experiment with other entries.

After that let us switch to the IDE we have installed. I would be using WING 101.


Now put all the entries we did up there on the top left window and save. You could name it Lesson 1.

Then press the green play button. You would get the output on the bottom right window.

You should have something like this.



That is it. CONGRATULATIONS. You have written your first code.

You can go ahead and try other entries on your own.

On to Lesson Two.


No comments:

Post a Comment