Basic concepts of python (Part- 1)

Hello friends!!! welcome to the New Age Informers. Today we are going to learn basic concepts of python programming. In my previous post, that was an introduction of python. So lets gets started!!

--> We know how to print statements in C and C++ languages. In here, we use the print statement to output text:-
 Exa:  >>> print 3, print 12 etc.

--> If we want to print some strings then we need to use parenthesis and single quotation just like this:-
Exa: >>> print ('Hello Python') 
            Here in python, there is no need to use semicolon after completing your statement.

--> It supports Arithmetic calculations.

Exa 1: >>> 3+2
           5
Exa 2: >>> 5+3-3
          5
Exa 3: >>> 2*(2+4)
           12
Exa 4: >>> 10/2
            5
Exa 5: >>> 11/0
             error
 
--> Python language also supports exponentiation, which means raising of one number to the power of another number.
Exa 6: >>> 3**5
            243
Exa 7: >>>3**(1.0/2)
           1.7320508075

 --> It also supports quotient. In this language, to determine the quotient and reminder of a division,we use the floor division and modulo operators.
Exa 8: >>> 18//4                    and             >>> 18%4
            4                                                      2
 Note: Just remember that (//) equates to quotient, which means how many of the latter numbers is in the former number(e.g. four 4 in 18). And (%) equates to remainder, which means what is remaining after dividing the quotient.

If you want to print some text, you have to use string in single or double quotation marks.
Exa : >>> 'Python is a language'
        'python is a language' 

So this is the part 1 of basic concepts. In next post we will learn part 2.

Until then bye bye!!

Follow us here for different kind of updates:

facebook: CLICK HERE!!!!!!!!!!

Twitter: @NewAgeInformers
  
Instagram: @new_age_informers_



Comments