Hello World!!

                         HELLO WORLD


In the previous Blog we learned How to install Python & IDE.
Today we will be starting our coding journey creating our first program.

STEPS:

1.OPEN PYCHARM
2.CREATE A NEW PROJECT(name it as you want)
3.Go to your project pane at the most left&right click at your project name
4.Go to new file & create a new python project & give it any name
5.You are now ready to start coding!!!

After, doing all these steps we can start coding!. Our first project is to programme a code which will print anything in the console.
We will be printing hello world firstly because it is the most popular statement used in any type of programming language. 

So, to print something in Python , we use the print() statement with 2 parenthesis.
So, our code will be like this:

print("Hello World")
>>Hello World 

Explanation:
For printing a statement which is a sentence i.e contains words we use two inverted commas to tell the interpreter that we want to print a statement & if we want to print a number then we remove these inverted commas. 

print(5)
>>5

print("5+8")
>>5+8

print(5+8)
>>13

Now, You can see that we can also add or do different operations between 2 numbers by printing the result and removing those inverted commas as it takes it as statement and thus dosen`t add them & print them as written.

In python if we want to fetch any character in a word we give them different id`s by which we know that what is what.
So these id`s are known as indexes where the first character starts from 0.

To know the first character of a word by using index number the syntax is:
print(word[indexnumber])

print("HelloWorld"[0])
>>H
print("Me"[1])
>>e

We can also get the total no of characters in a string (word) by using the "len()" function.

print(len("hello"))
>>5

print(len("my_name_is_he")
>>10

So, now we have learnt that what is the print statement, how to add numbers & different operations done on a string.

If you want a visual teaching on this topic then refer to this video:

---------------------------------------------------------------------------
Laptop I use: https://amzn.to/2Yr6Vb2 Headphones I use: https://amzn.to/31hDNF7 Mics: https://amzn.to/31hEcr7 -------------------------------------------------------------------- Follow On: Instagram- https://www.instagram.com/shubham.__.... --------------------------------------------------------------------





1 comment:

  1. How absurd post try using notice fonts. Follow me on insta

    ReplyDelete

Powered by Blogger.