Introduction to Python: Say hello to Python

When it comes to work human always find the easy way to do it because we are quiet lazy in nature. So, when it comes to do a work like programming and coding most of us(human) want a language in which the lines of code should be minimum to execute our problem. So, in this case Python have the higher priority to the rest of others.

What is Python- a snake or programming language?

Python is a snake but we don’t have to discuss it here, lets discuss about python programming language.

  1. Python is a (for more, click on the underlined text).Python is designed to be highly readable that is it mostly uses English keywords like [“and”, “is”, “in”, “not”,….] that's make it easily understandable.
  2. Python is good for beginners’ as it have many inbuilt function and methods which helps the same to get comfortable and used to it.
  3. Python is a community driven language that is why there are hundreds of library.
  4. Python supports functional and structured programming methods as well as OOP.
  5. There is no need to count curly braces {} as python uses indentation.

Every language has some concept that is necessary to understand such as its syntax, Keywords, identifier, statement, comments, and Data types.

What is Keywords?

Keywords are the reserved English words that are used by language compiler to understand a particular thing. For example: for, while, return, break, def, if, else, and, or…. and so on. The important to be noticed is you can not use these English words as a variable to store any data or value. For example:

As you can see in above figure none of the value is assigned to the keywords.

In python 33 keywords are present: [“if”,”else”,”elif”,”in”,”False”,”None”,”True”,”is”,”for”,”while”,”await”,”return”,”yield”,”break”,”pass”,”continue”,”and”,”as”,”or”,”class”,”assert”,”async”,”def”,”import”,”raise”,”finally”,”except”,”lambda”,”try”,”nonlocal”,”del”,”global”,”not”,”with”] , and for more

What is identifiers?

User defined(written by user in a program)English words used to store value or data. These English words are also known as variable. They can be varying from [a-z,A-Z] or can be combination of letters and whole numbers [0-]. Variable name that are used to easily understand what they are doing.
But they neither start with number nor have special character except underscore(_). For example:

What are comments?

Comments are the sentence which is written by coder or programmer to define what a particular line is doing in the program. It doesn’t have any affect on the code.

# hastag is used for single line comment.

‘ ‘ ‘ three opening and closing inverted comma are used for multiline comment’’’.

What is data types?

a data type or simply type is an attribute of data which tells the compiler or interpreter how the programmer intends to use the data. Take a look at some of the data types:

there are more

python is smart enough to understand the type of variable. So, you don’t have to mention the data type just like you did in C or java.

After all of this theory let’s print our universal newbie English clause “Hello World !”

For doing this you just have to write print(“Hello World !”) and Hello World ! will be displayed.

Kudos! we did that and i am using live interpreter

print() is a function(output function) that is used to display the value or string which are written in the parenthesis. Similarly, input() function is used to take the input from the user. Remember always, the input always come in string data type.

as you can see above when the number is entered by user its data type is String that means whether user enter number or name it will always come in string format. You can convert it by using int(input(“enter your roll number”)).

so, create your program and fell in love with python.

If there is any mistake, please comment down.

More topics will be updated on regular basis because i am still a newbie.

Thank you for reading.

Linux Guy