Python Language Learning: A Comprehensive Guide with Learn Python the Hard Way

 PYTHON-

Python Language Learning: A Comprehensive Guide with Learn Python the Hard Way



 Designed by- Guido van rossum.
 Developer  - Python software foundation.
 First appeared -1990
 File name extensions - .py,.pyi,.pyc,.pyo,.pyw,.pyz.

          Python is an interpreted, high-level, general-purpose programming language. it is simple and easy to learn, powerful, high level and object oriented programming language. python syntax and  dynamic typing with its interpreted nature makes it an ideal language for scripting and rapid application development.


     python is easy to learn and powerful and versatile
scripting language.it has a large and comprehensive standard library. python support multiple programming pattern, including object oriented, imperative and functional or procedural programming styles.
      
      now a days python is a most demanding language in the world. python language code is very small and easy to understand. many application created by python language.


FEATURES OF PYTHON-



  •   Easy to learn and use.                                                                                                     
  •   Object oriented.                                                                                                                                                         
  •   Extensible.                                                                                                                                                                               
  •   Large standard library.                                                                                                                                     
  •   Integrated.                                                                                    
  •   Cross platform language.                                                                                                                       
  •   Free and open source.                                                                                                                                                            

 python versions -


  • python 1.0 relese date-  Jan 1994                                       
  • Python 1.5  relese date- 31 Dec 1997                                     
  • Python 1.5.2  relese date -  April 1999                                       
  • Python 1.6  relese date-  05 Sep 2000                                
  • Python 2.0  relese date-  16 Oct 2000                                          
  • Python 2.0.1  relese date-  22 Jun 2001                                 
  • Python 2.1  relese date - 17 Apr 2001                                    
  • Python 2.2  relese date - 21 Dec 2001                                       
  • Python 2.3  relese date-  29 Jul 2003                                         
  • Python 2.4  relese date-  30 Nov 2004                                     
  • Python 2.5  relese date-  19 Sep 2006                                         
  • Python 2.6  relese date-  01 Oct 2008                                        
  • Python 2.7  relese date- 03 Jul 2010                                   
  • Python 3.0  relese date-  03 Dec 2008                                         
  • Python 3.1  relese date-  27 Jun 2009                                    
  • Python 3.2  relese date-  20 Feb 2011                                 
  • Python 3.3  relese date-  29 Sep 2012                                   
  • Python 3.4  relese date-  16 Mar 2014                                    
  • Python 3.5  relese date-  13 Sep 2015                                 
  • Python 3.6  relese date-  23 Dec 2016                                 
  • Python 3.7  relese date-  27 Jun 2018                                 
  • Python 3.8  relese date-  14 Oct 2019                                      
  • Python 2.4.6  relese date-  19 Dec 2008                                   
  • Python 2.5.6  relese date-  26 May 2011                                     
  • Python 2.6.9  relese date-  29 Oct 2013                                   
  • Python 2.7.10  relese date- 23 May 2015                                 
  • Python 2.7.13  relese date-  17 Dec 2016                              
  • Python 3.5.3  relese date-  17 Jan 2017                                                 
  • Python 3.6.10  relese date- 18 Dec 2019                                  
  • python 3.8.2  relese date- 24 feb 2020                                                 

Python compilers -


  • Psyco                                                                                     
  • Cython                                                                                  
  • Shed Skin                                                                              
  • PyPy                                                                                        
  • Nuitka


python basic programs


Q1)write a program in python to print hello world

-->
print('Hello world')

output - Hello world. 
----------------------------------------------------

Q2)write a program in python to addtion of two number.

-->



num1 = 5
num2 = 6

sum = num1 + num2

print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))

output - the sum of 5 and 6 is 11.
----------------------------------------------------------

Q3) write a program in python swipping of two number using third variable.

-->

x = 3
y = 6

# To take inputs from the user
#x = input('Enter value of x: ')
#y = input('Enter value of y: ')

z = x
x = y
y = z

print('The value of x after swapping: {}'.format(x))
print('The value of y after swapping: {}'.format(y))

output - The value of x after swapping: 6
             The value of x after swapping: 3
-----------------------------------------------------------

Q4)write a program in python to find fatorial of a number.

--->

num = 5

# To take input from the user

#num = int(input("Enter a number: "))

factorial = 1

# check if the number is negative, positive or zero
if num < 0:
   print("Sorry, factorial does not exist for negative numbers")
elif num == 0:
   print("The factorial of 0 is 1")
else:
   for i in range(1,num + 1):
       factorial = factorial*i
   print("The factorial of",num,"is",factorial)

output - The factorial of 5 is 120
-------------------------------------------------------------------------

Q5)Write a program in python to sum of given number.

-->

def getSum(n):
 
    sum = 0
    while (n != 0):
     
        sum = sum + int(n % 10)
        n = int(n/10)
     
    return sum
 
n = 12
print(getSum(n))

output - 12

Post a Comment

2 Comments