Basic fundamentals of python part 3

By // No comments:
Some Operations and type Conversions:-
This concepts is more helpful for beginners and professionals.You can learn python basic concepts from here with examples.This concepts are more helpful to learn advance python programming also. 
There are some operations and type conversions in python programs as given below:-
  • Arithmetic operators :-
+, -, *, /, %, //, **
+ --> Addition of two numbers(digits).
e.g.
a=9
b=5
c=a+b
print(c)
Output:-
14

- --> Subtractions of two numbers.
e.g.

a=10
b=5
c=a-b
print(c)
Output:-
5

--> Multiplication of numbers.
e.g.

a=10
b=5
c=4
d=a*b*c
print(d)
Output:-
200
/ --> Division of Two numbers.
a=100
b=5
c=a/b
print(c)
Output:-
20.0

%  --> It returns remainder
e.g.

a=10
b=3
c=a%b
print(c)
Output:-
1

**  --> Exponential operator 

e.g.
base=3
exponent=4
result=base**exponent
print("Exponential value is:",result)
Output:-
Exponential value is: 81
                             OR
Use pow( ) function:-To calculate exponent value on any base ,python uses pow() function.
base=3
exponent=4
result=pow(base,exponent)
print(result)
Output:-
Exponential value is: 81
Note:- To calculate exponent value on base e,python uses exp( ) function.
e--> mathematical constant
e=2.71828 (approx)
First import math module for use exp( )  function in python programs.
Syntax:-
math.exp(exponent)
program:
import math
exponent=4
result=math.exp(exponent)
print (result)

Output:-
54.598150033144236

// -->it returns quotient after discarding fractional part(decimal point).
e.g.
a=50
b=3
c=50//3
print(c)
Output:-
16

  • Compound  assignments operators :-
There are following compound assignments operators used in python programs as shown below:-
+= , -= ,/= , %= , **= , //=
a+=5 : #same as  a=a+5
a-=5 : #same as  a=a-5
a*=5 : #same as  a=a*5
a/=5 : #same as  a=a/5
a**=5 : #same as  a=a^5
a//=5 : #same as  a=a//5

  • Type conversions:- In Python Programs ,we can convert one numeric type to another using built-in function int(),float(),complex(),char(),str() and bool().
1. )   int(float/numeric string)  # from float to int & float to numeric string
e.g.
int(3.5)                             #output: 3
int('786')                           #output: 786
  
2.)  int (numeric string, base)        # from numeric string to int in base
e.g.
  int ('123',10)            #output: 123

3.) Complex(int / float) # convert to complex  with imaginary part 0
e.g.
complex(25)                  #output: 25+0j
complex(25.70)               #output: 25.70+0j

4.) complex(int\float , int/float       # convert to complex 
e.g.
complex(5,7)                     #output 5+7j
complex(5.3,7.5)            #output 5.3+7.5j
complex(5.3,7)                #output 5.3+7j
complex(5,7.5)               #output 5+7.5j

5.) bool(int / float)              # from int/float to True/False (1/0)
e.g.
bool(24)                                  #output True
bool(12.60)                            #output True
bool(1)                                    #output True
bool(0)                                   #output False
bool()                                      #output False
bool(True)                             #output True
bool(False)                            #output False
bool(None)                            #output False

6.) str(int/float/bool)         # convert to string
e.g. 
str(50)                                         #output '50'                        
str(6.4)                                        #output '6.4' 
str(True)                                     #output 'True' 
str(Flase)                                    #output 'False' 

6.) chr(int)                  # convert to Unicode character
e.g.
chr(0)                                        #output '\x00'
chr(5)                                        #output '\x05'
chr(65)                                      #output 'A''
chr(67)                                      #output 'C'
chr(95)                                      #output '-'
chr(125)                                      #output '}'

#Watch Complete Video:-

3

Basic fundamentals of Python part 2

By // No comments:
Python keywords :-
  • Python has 33 keywords that are given below.
  • All keyword in lowercase except(False,None&True)

Note ->
  • keyword is not used as identifier name in the application.
3

Basic fundamentals of Python part 1

By // No comments:
There are following basic fundamentals of python as given below.
  1. Tokens
  2. Comments,Indentation and multi-lining
  3. Python types
  4. Operations and conversions
  5. Built-in functions
  6. Library functions
1.) Tokens :-
  • Token can be defined as a reserved word, punctuation mark and each individual word in a statement .
  • Token is the small unit in the given program.
3

Python Programming Modes

By // No comments:
There are two modes of python programs.
  1. Interactive Modes
  2. Script Modes
1.) Interactive Mode :- 
  • It is used for exploring Python syntax,seek help and debug short programs.
  • Interactive modes uses IDLE (Python Integrated development and Learning Environment).
  • It is available in windows after installation of python setup. Go Start Button--> Search IDLE --> open IDLE python--> It will be opened python shell prompt window-->You can run your python codes from here.
3

How to install Python software on Window Linux Unix and Macintosh operating systems easily

By // No comments:
Hi friends , Today we will learn "How to install python software on window 7,window 8 and window 10 easily".There are many student who are facing problem to install python software on your window 7 ,window vista or window xp. Here we will solve each problems step by steps through our video.You can watch the video and install python software on your window Linux and Macintosh OS easily.  In this tutorial we will solve three type of problems which affects to install the python .
  1. You are not download correct software on the basis of your machine architecture.
  2. Your window 7 or window vista has missing some files.
  3. Your Environment variable path is not set correct in your machine.
3

Learn Python Concepts History Features and its Applications in today real lifeprojects

By // No comments:
Python is a simple general -purpose, interpreted, interactive, high level and object oriented programming language.
Python was created by Guido Van Rossum during 1985 - 1990. 
This python tutorial is designed for beginners and professionals. Every student and professional can learn  on your home without any institutions.You can learn each concepts of python step by step from here.
  • The idea came for python 1980s.
  • Python start in implementation December 1989s.
  • February 1991 ,Guido Van Rossum published the codes version 0.9.0
  • Guido Van Rossum was born 31 January 1956 in Netherlands.
  • He did the Master’s degree in the mathematics and computer science from University of Amsterdam in 1982.
  • Guido later worked for various research institutes, such as Dutch Centrum Wiskunde & Informatica (CWI), United States National Institute of Standards and Technology (NIST), and also Corporation for National Research Initiatives (CNRI).
  • Python language is derived from two languages
  1. ABC Programming language
  2. Modula-3 language

  • ABC language was also derived from SETL programming language.
  • Guido Added some extra features in python as Exceptional handling concepts Which was early present in ABC language.
  •  Guido worked at Google from 2005 till 7 2012 .
  • Guido joined the cloud file storage company Drop box in 2012.It was surprising to all
  • Python’s name is derived from a television comedy series called “Monty Python’s Flying Circus” according to Guido van Rossum.
3
Powered by Blogger.