Posts

Showing posts from June, 2023

Statements and control flow in python

Image
  Statements and control flow  Python's  statements  include: The  assignment  statement, using a single equals sign  = The  if  statement, which conditionally executes a block of code, along with  else  and  elif  (a contraction of else-if) The  for  statement, which iterates over an iterable object, capturing each element to a local variable for use by the attached block The  while  statement, which executes a block of code as long as its condition is true The  try  statement, which allows exceptions raised in its attached code block to be caught and handled by  except  clauses (or new syntax  except*  in Python 3.11 for exception groups [86] ); it also ensures that clean-up code in a  finally  block is always run regardless of how the block exits The  raise  statement, used to raise a specified exception or re-raise a caught exception The  class  statement, which executes a block of code and attaches its local namespace to a  class , for use in object-oriented programming The  d

Design philosophy and features in python

Image
  Design philosophy and features   Python is a  multi-paradigm programming language .  Object-oriented programming  and  structured programming  are fully supported, and many of their features support functional programming and  aspect-oriented programming  (including  metaprogramming [66]  and  metaobjects ). [67]  Many other paradigms are supported via extensions, including  design by contract [68] [69]  and  logic programming . [70] Python uses  dynamic typing  and a combination of  reference counting  and a cycle-detecting garbage collector for  memory management . [71]  It uses dynamic  name resolution  ( late binding ), which binds method and variable names during program execution. Its design offers some support for functional programming in the  Lisp  tradition. It has  filter , map and reduce  functions;  list comprehensions ,  dictionaries , sets, and  generator  expressions. [72]  The standard library has two modules ( itertools  and  functools ) that implement functional to

Intro of python

Image
  Python Python  is a  high-level ,  general-purpose programming language . Its design philosophy emphasizes  code readability  with the use of significant indentation via the  off-side rule . [34] Python is  dynamically typed  and  garbage-collected . It supports multiple  programming paradigms , including  structured  (particularly  procedural ),  object-oriented  and  functional programming . It is often described as a "batteries included" language due to its comprehensive  standard library . [35] [36] Guido van Rossum  began working on Python in the late 1980s as a successor to the  ABC programming language  and first released it in 1991 as Python 0.9.0. [37]  Python 2.0 was released in 2000. Python 3.0, released in 2008, was a major revision not completely  backward-compatible  with earlier versions. Python 2.7.18, released in 2020, was the last release of Python 2. [38] Python consistently ranks as one of the most popular programming languages. [39] [40] [41] [42] Histo