Notes of Python Workshop, Python December 04_211204_211712.pdf.PDF.pdf - Study Material
Page 2 :
Programming Languages and their Types, Definition, A programming language is a set of commands, instructions, and other syntax used to, create Computer Programs., Example: Python, C, C++, Java, Swift, Ruby, Kotlin, etc., , Types (On the Basis of Level), 1. Machine Language: Set of instructions that directly control a computer’s Central, Processing Unit (CPU)., Example: Binary Language., 2. Low-Level Language: Set of instructions that are close to machine language and, have less abstraction but are readable by humans. Allows user to work on system, hardware., Example: Assembly Language., 3. Middle-Level Language: Set of instructions that allows user to do system, programming for writing operating system as well as application programming., Example: C and C++., 4. High-Level Language: Set of instruction that are closer to human language and is, usually independent of a particular type of computer. Used to develop multiplatform applications., Example: Python, C#, PHP, Ruby., , Major Differences Between High-Level Languages and Low-Level, Languages, , 2
Page 3 :
High-Level Language, , Low-Level Language, , Programmer friendly language., , Machine friendly language., , Less memory efficiency., , High memory efficiency., , Simple to debug., , Complex to debug., , Simple to maintain., , Complex to maintain., , Portable., , Non-Portable., , Runs on any platform., , Machine dependent., , Needs compiler/interpreter for, translation., , Needs assembler for translation., , Major Differences Between Compiler and Interpreter, Compiler, , Interpreter, , Compiler scans the whole code and, translate whole into machine code., , Interpreter translates just one statement, at a time into machine code., , Overall time of execution is fast., , Overall process to execute is slow., , Intermediate object code is generated, thus more memory needed., , No intermediate code is generated thus, highly memory efficient., , Debugging is hard., , Debugging is comparatively easy., , Example: C and C ++., , Example: Python, Ruby., 3
Page 4 :
Types (On the Basis Programming Paradigm), 1. Imperative Programming: It is the programming paradigm that describes how the, program executes. (Control flow of computation), Example: Fortan, Java, C++., 2. Declarative Programming: It is the programming paradigm that describe what, program to be executed. (Logic of computation), Example: Haskell, Prolog, Erlang., , Advantages and Applications of Python Programming, Advantages of Python Programming, 1., 2., 3., 4., 5., 6., , Easy to read, write and learn., Extensive support library., Open Source and community development., Dynamically typed language., Portable across Operating Systems., Object-oriented Language., , Dynamically Typed: No need to mention the data type before declaring the variable., Datatype are assigned automatically on the basis of value., Object-oriented programming: Object is image of a class that contains data in form of, fields (attribute/properties) and code in form of procedures (method). Object-oriented, programming is based on concept of Objects., , Applications of Python Programming, 1. GUI (Graphical User Interface) based Applications which can be platform, independent., 2. IoT (Internet of Things)., 4
Page 5 :
3., 4., 5., 6., 7., 8., 9., , Automation (both hardware as well as software)., Data Science, Machine Learning and AI., Image processing and Graphic Designing., Web framework (Django and Flask)., Quantum Computation., Enterprise, Business and Stock Market., Science, Engineering, Research and Education., , ORGANISATIONS USING, PYTHON, , 5
Page 6 :
Python Programming Basics, Pip and Packages, PIP: Package management system used to install and manage software packages, written in python. PIP is a package installer in python., Example: (Command) pip install selenium, Packages: A package is collection of python modules. Packages are directories in, python that contains the __init__.py. Packages are a way of structuring Python’s, module., Modules: It is a python file that contains pre-built functions that can be used for, specific purposes. A module is a python file (.py file) containing variable, functions and, classes., , Variables and Datatypes, Variables: Variable is a name given to memory location in python. It is basic storage, unit in a program., The type of variable is declared automatically as python is a dynamically typed, language., The value stored in the variable can be changed during a program., Rules for declaration of a variable:, 1. A variable name must start from a letter or underscore character., 2. A variable name cannot star from a number., 3. Variable names should contain only alpha-numeric character or underscores (Az, 0-9, and _)., 4. Variables are case-sensitive (check, Check, and CHECK are 3 different variables)., 5. Keywords cannot be variable name., 6
Page 7 :
Datatypes in Python: It tells the kind of value that tells what operations can be, performed on a particular data., As python is Object-oriented programming, data types are classes and variables are, instances of the class., , PYTHON - DATA TYPES, , NUMERIC, , SEQUENCE, , BOOLEAN, SET, , DICTIONARY, , LIST, , COMPLEX, INTEGER, , STRING, , FLOAT, , STRING, NUMERIC, BOOLEAN, , 7, , TUPLE
Page 8 :
Type Casting: Type casting is a method to convert the variable data type into certain, data type in order to the operation required., , Implicit, , Explicit, , Python converts data type of a variable, into another data type automatically., , Python needs user involvement to, convert the data type of a variable to, another data type., , Input and Print Functions, , VALUE, , PROCESS, , OUTPUT, , input(): Allows user to insert a value into a program. The function returns a string, value., Example: a = int(input(“Please insert a number:”)), print(): Prints the message on the screen or on any other standard output device., Example: print(a), , 8