Connect with us

All Batch

Introduction To Python | Python For Beginners

Published

on

HISTORY OF PYTHON

Python laid its foundation in the late 1980’s. Implementation of python was started in 1989 by Guido Van Rossum. In 1994, python 1.0 was released with new features like maps, lambda, filter and reduce, python 2.0 added new features such as list comprehensions, garbage collected systems. Python was influenced by ABC Language, modula3.0 .

WHAT IS PYTHON?

It is a general purpose, dynamic ,high-level, and interpreted language. It supports OOP approach to develop applications. It makes the development and debugging fast because of no compilation involved in development. It is multipurpose programming language because it can be used in web development, data science, 3D CAD.

WHY PYTHON?

According to stack overflow survey, python is the fastest major growing programming language, python is the most loved and wanted from 2018.

PYTHON FEATURES:

  1. Easy to learn
  2. Expressive language
  3. Interpreted language
  4. Cross platform
  5. Free and open source
  6. OOP language
  7. Large standard libraries
  8. GUI programming support

KEYWORDS IN PYTHON:

Keywords are reserved words of python, Keywords cannot be used as variables or functions, Keywords are case-sensitive.

eg; False, Class, Finally, Is, Return, Continue etc….

IDENTIFIERS

Identifiers are names given to function ,variables,class.

RULES OF WRITING IDENTIFIERS:

  1. Identifiers can be combination of lower case(a-z),upper case(A-Z),numbers(0-9),underscore(_).
  2. Identifiers should not start with numbers.
  3. Don’t use any keywords as identifiers.

RULES FOR TO MAKE OTHER DEVELOPER TO EASILY UNDERSTAND CODE:

  1. Try to write identifier with length greater than 5.
  2. Never write single or double characters as identifiers.
  3. Use underscore if it is long identifier.
  4. Use camelCase whenever necessary.
  5. Don’t use temp,tmp variables until it is really temporary variable.

VARIABLES

Variables are used to store information , which can be used across the program. Variables cane be changed across the program, it is like a name to the location where data/value is stored. In python,declaring and initializing of variables is done at same time.

DATA TYPES

  1. Numbers
  2. String
  3. Boolean
  4. List
  5. Tuple
  6. Set
  7. Dictionary

” everything in python is object”

NUMBERS(int,hexa,octa,decimal):

NUMBERS:

  1. Integers: 1,2….
  2. Float: 1.0,1.2…
  3. Complex : a+bi

STRING:

We can use ‘ , ” “, ” ” “

eg: aname = ‘python programming’ bname=”scalar programming”, cname=””” hadoop administration”””

LIST:

  1. List contains set of elements
  2. Elements can be set of elements or strings or any combination
  3. List elements are defined in [ ]
  4. We can update any element in the list
  5. eg: list=[10,20,30,40]

TUPLE:

  1. Tuple contains set of elements
  2. Elements can be set of numbers or strings or any combination
  3. Tuple elements are defined in( )
  4. Inside tuple we cannot modify any element directly’
  5. we can modify an element in tuple by converting it into the list
  6. eg: (10,20,30)

DICTIONARY:

  1. Dictionary contains elements in key value pairs
  2. Dictionary elements are defined in
  3. Key is used to uniquely identify the values
  4. Keys : number or string
  5. Values: number or string or list or tuple or dictionary
  6. eg: Book=“chap1″:10,”chap2”:20

SET:

Unordered collection of unique elements of same type is called as set.set elements are defined in

eg: 10,10,30,40

” A PERSON WHO FIXED A PROBLEM THAT YOU DON’T KNOW YOU HAVE ,IN A WAY YOU DON’T UNDERSTAND”

FUNCTIONS AND METHODS:

http://www.python cheat sheet

METHODS: Methods are object specific. Every object has its own different methods ,string methods are different ,list methods are different. Every method is accessed by “,” operator.

FUCNTIONS: Functions are common for all objects.

eg: print(), len()

BUILT-IN FUNCTIONS:

print(),len(),type(),input(),isinstance(),range(),min(),max(),sum(),id(),dir()

CONDITIONAL STATEMENTS

  • if
  • if else
  • if -elif-elif-else

CONTROL STATEMENTS

  • for
  • while

JUMP STATEMENTS

  • break
  • continue

FILE HANDLING

There are two types of files:

  1. Flat files : csv,txt are opened directly
  2. Third party files:All files ending with .docx/doc ,pdf are opened with some third party libraries

EXCEPTION HANDLING

Handling the errors in the runtime is known as exception handling.

Keywords:

  • try
  • except
  • else
  • finally
  • raise

LIBRARIES:

There are two types of libraries.

  1. Built-in libraries: Used by everyone ,installed within python by default.http://www.python os documentation
  2. Third party libraries: Depending on the requirement developer has to use third party library from http://www.pypi.org

“YOU MIGHT NOT THINK THAT PROGRAMMERS ARE ARTISTS,BUT PROGRAMMING IS AN EXTREMELY CREATIVE PROFESSION. ITS LOGIC-BASED CREATIVITY.”

CONCLUSION:

The preceding content of this blog have been intended to give the reader an understanding way of python.

The post Introduction To Python | Python For Beginners appeared first on GeeksGod.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Newsletter

Trending

Copyright © 2019 - 2020