Skip to main content

First Program : Python For Beginner


 Python :

Python is high level programming language with application in numerous areas including web programming, scripting, scientific computing, and artificial intelligence.

First Program: "Hello World"

So let's take our first foot into the world of Python.Open the console and type :                    print("Hello World") and press enter.                                                                                                                                          

Hurry!! you have just created your first program. But remember python is case sensitive here P & p are different for python, so be careful about this.

Printing Text : 

The print statement can also be used to output multiple lines of text. To do so you have to use three quotation marks{"} and put the text between them.  

There are some other methods as well for the multiple line text output, like instead of using three quotation marks we can use {\n} to escape a newline in text aka string. 

Simple operations in python:                                                       

Python has the capability of carrying out
calculations.Enter a calculation directly into the python   console, and it will give you the output. Like if you want to perform the addition operation just type the numbers and place the {+} sign between them and then hit the enter.  

 Subtraction, Multiplication, Division: 

Now to perform subtraction use {-} sign in between the numbers, for multiplication use {*} sign and for division use the symbol {/} and {//} for  floor division.                                                                 

 



Exponential : 

Beside addition, subtraction, multiplication and division, python 
also support exponentiation, which is the raising of one number of
 another. This operation is performed using two asterisks {**}

                                                                                                   

You can find out square root, cube root and various other exponential powers of a given number.

Quotient and Remainder :

To determine the quotient and remainder of a division, use floor division{//} and modulo{%} operators respectively.

Floor division is done using two forward slashes{//}.

The modulo operation is carried out with a percent {%} symbol.

The operators can be used with both floats and integers. 



Note :

These are some of the introductory program for the python beginners. It will give them the essence of coding while performing these tasks. So perform these by yourself and keep your learning trajectory upwards.


Comments

Popular posts from this blog

Strings and Strings operations in Python.

 Strings: If you want to enter text in python, you have to use a string. A string is created by entering text between two single or double quotation marks ("Text" or 'Text'). Some characters can't be directly included in a string. Say for example the double and single quotes can not be directly included in a double or  single quote string. This will end the code prematurely and can cause error. You can enter these kind of symbols by using { \ } before them. Other common characters that must be escaped are newlines and backslashes. Double quote only need to be escaped in double quote and is true for single quote as well. Note : Backslash can also be used to escape tabs, arbitrary unicode characters, and various other things that can't be reliably printed. These characters are called as escape characters. Newlines: We can create a newline or escape a newline in python using {\n} in place from where you want to start the new line. But python provides an easy w

Introduction To Python : Python For Beginners

What is Python ? Python is the most popular general purpose (Multi purpose) programming language now a days.It's used in almost everything  from machine learning to software development.   Python is a high level programming language with application in numerous areas, including web programming, scripting, scientific computing and artificial intelligence.Python is processed at runtime by the interpreter .It focus on object oriented programming and code readability. Why Python ? It's easy to learn :  Python doesn't have very complex syntax structure so it is easier to learn python than the other programming languages. Simple syntax means time needed to learn  python is shorter from many other programming languages. Teaching Python is easy : As we know that the syntax of python programming is simple so teaching it will be easier.Thus the teacher can put more time and energy in general programming techniques. Understanding the python code is easy : Due to its simplicity and its