This document provides an overview of Microsoft Word and its features. It begins with objectives for learning Word and defines word processing. It then describes how to open Word and identifies the main components of the Word window like the ribbon, ruler, text area, and status bar. The document explains how to perform basic text formatting and editing tasks in Word like changing font size and style, inserting headers and footers, setting page orientation and margins. It also covers more advanced functions such as adding bullets and numbers, using proofing tools, inserting graphics, and printing documents. The document encourages practicing the skills by writing a short piece and including at least 3 features learned.
This document outlines learning objectives and tasks for a Microsoft Word course. It covers topics like keyboard shortcuts, formatting tables, creating documents, smart art, mail merges, and showcasing skills. The objectives focus on understanding important Word skills like using shortcuts, formatting text and tables, adding headers/footers, and creating professional documents. Learners are assigned tasks like creating documents and mail merges to practice these skills. They are also instructed to update a tracker sheet to log their progress and skill level.
The document provides an overview of a Power BI training course. The course objectives include learning about connecting to data sources, transforming data, building data model relationships, using DAX functions to transform data, and creating visualizations. It discusses topics like importing data from CSV and Excel files into Power BI, using Power Query to transform data, establishing relationships between tables in the data model, using measures and columns with DAX, and building basic and dynamic visualizations. It also provides resources for sample data files and additional learning materials for the course.
Microsoft Office is a suite of desktop applications, servers and services introduced in 1989. It originally included Word, Excel and PowerPoint. Over time, Office applications have integrated shared features.
The current versions are Office 2013 for Windows and Office 2011 for Mac. Office 2013 was released in October 2012 and includes updated versions of Word, Excel, PowerPoint and other applications.
Word is a word processor that was previously the main Office application. It saves documents in the .docx format and is available for Windows and Mac. The first version of Word was released in 1983 for MS-DOS and introduced the mouse.
Williamson’s model of managerial discretionPrabha Panth
1) Williamson's model of managerial discretion posits that in imperfect markets, managers will seek to maximize their own utility rather than profits for owners.
2) The model suggests that manager's utility depends on three variables: staff expenditures which boost sales and prestige; management emoluments such as perks; and discretionary investments for ego and pride.
3) Managers have an area of discretion between the actual profits earned and the minimum profits expected by owners, within which they can allocate resources to maximize their own satisfaction defined by the three variables.
This document discusses supply chain management. It begins by outlining learning objectives related to explaining the strategic importance of supply chains, identifying sourcing strategies, and describing supplier selection steps. It then defines a supply chain as the flow of goods from raw materials to end customers, integrated through information sharing. The objective of supply chain management is to coordinate activities across the supply chain to maximize competitive advantage and customer benefits. It also discusses measuring supply chain performance through inventory as a percentage of assets and calculating inventory turnover.
Raman spectroscopy is a technique that analyzes the scattering of monochromatic light, such as from a laser, after its interaction with molecular vibrations. Most light is elastically scattered, but a small amount is scattered at optical frequencies that are different from the incident light. This provides a fingerprint by which molecules can be identified. Raman spectroscopy is useful for chemical analysis and is non-destructive. It can identify materials through glass or plastic and does not require complex sample preparation.
Python modules allow code reuse and organization. A module is a Python file with a .py extension that contains functions and other objects. Modules can be imported and their contents accessed using dot notation. Modules have a __name__ variable that is set to the module name when imported but is set to "__main__" when the file is executed as a script. Packages are collections of modules organized into directories, with each directory being a package. The Python path defines locations where modules can be found during imports.
This document provides an introduction to the Python programming language. It discusses Python's design philosophy emphasizing readability. It also covers printing messages, reading input, variables and data types, operators, and basic syntax like comments and identifiers. Arithmetic, relational, logical and bitwise operators are explained along with examples.
Python modules allow for code reusability and organization. There are three main components of a Python program: libraries/packages, modules, and functions/sub-modules. Modules can be imported using import, from, or from * statements. Namespaces and name resolution determine how names are looked up and associated with objects. Packages are collections of related modules and use an __init__.py file to be recognized as packages by Python.
How to download and install Python - lesson 2Shohel Rana
We will follow some steps to complete the installation process of Python.
1. Download the Python installer from Python website.
2. By double clicking install it.
3. Set the path for Python
4. Check Python is working very well.
5. If you missed the path setting for Python, then uninstall it and re install Python.
The document discusses object-oriented programming concepts in C#, including defining classes, constructors, properties, static members, interfaces, inheritance, and polymorphism. It provides examples of defining a simple Cat class with fields, a constructor, properties, and methods. It also demonstrates using the Dog class by creating dog objects, setting their properties, and calling their bark method.
This document provides an introduction to Python programming concepts including data types, operators, control flow statements, functions and modules. It discusses the basic Python data types like integers, floats, booleans, strings, lists, tuples, dictionaries and sets. It also covers Python operators like arithmetic, assignment, comparison, logical and identity operators. Additionally, it describes control flow statements like if/else and for loops. Finally, it touches on functions, modules and input/output statements in Python.
This document provides information about dictionaries in Python. It defines dictionaries as mutable containers that store key-value pairs, with keys being unique and values being of any type. It describes dictionary syntax and how to access, update, delete and add elements. It notes that dictionary keys must be immutable like strings or numbers, while values can be any type. Properties of dictionary keys like no duplicate keys and keys requiring immutability are also summarized.
The document discusses various Python datatypes. It explains that Python supports built-in and user-defined datatypes. The main built-in datatypes are None, numeric, sequence, set and mapping types. Numeric types include int, float and complex. Common sequence types are str, bytes, list, tuple and range. Sets can be created using set and frozenset datatypes. Mapping types represent a group of key-value pairs like dictionaries.
The document discusses lists in Python, including how to create, access, modify, loop through, slice, sort, and perform other operations on list elements. Lists can contain elements of different data types, are indexed starting at 0, and support methods like append(), insert(), pop(), and more to manipulate the list. Examples are provided to demonstrate common list operations and functions.
Operator & control statements in C are used to perform operations and control program flow. Arithmetic operators (+, -, *, /, %) are used for mathematical calculations on integers and floating-point numbers. Relational operators (<, <=, >, >=, ==, !=) compare two operands. Logical operators (&&, ||, !) combine conditions. Control statements like if-else, switch, while, for, break, continue and goto alter program execution based on conditions.
An array is a collection of elements of the same type stored in contiguous memory locations that can be accessed using an index. Arrays allow storing multiple values as a single variable. One-dimensional arrays store elements in a list, while multi-dimensional arrays arrange elements in multiple dimensions. Elements are accessed using their position indices, which must be within the array bounds. Arrays can be initialized during declaration and values accessed using loops. Operations like input, output and searching are commonly performed on array elements.
This document discusses random functions in Python. It explains how to import the random module and describes several functions:
- random() generates random float numbers between 0 and 1
- randrange() returns random integers within a given range
- randint() returns random integers within a range similar to randrange()
Examples are provided to demonstrate how to use these functions to generate random numbers between certain values or in lists.
The document discusses key concepts in Java including classes, objects, methods, and command line arguments. A class defines common properties and behaviors for objects through fields and methods. Objects are instantiated from classes and can access fields and methods using dot notation. Command line arguments allow passing data into a Java application and are accessed through the args parameter in the main method.
This document provides an introduction and overview of the Python programming language. It discusses that Python was created by Guido Van Rossum in 1991 and named after Monty Python. Python can be used for both procedural and object-oriented programming approaches. It is an interpreted language that is free to use, easy to learn, and has a simple syntax. Python is popular for web development, data analysis, science/engineering, and more. The document then covers Python syntax and provides examples of using variables, data types, and the interactive mode versus script mode of writing Python code.
Exception handling in Python allows programmers to handle errors and exceptions that occur during runtime. The try/except block handles exceptions, with code in the try block executing normally and code in the except block executing if an exception occurs. Finally blocks ensure code is always executed after a try/except block. Programmers can define custom exceptions and raise exceptions using the raise statement.
Data types in C include primary (fundamental) types like integers and floating-point numbers, as well as derived and user-defined types. Primary types include integers of various sizes (char, short, int, long) that can be signed or unsigned, and floating-point types like float, double, and long double. Integer types have size and value ranges that depend on the machine, such as 8-bit char from -128 to 127. Floating-point types have prescribed sizes and precision levels. User can define their own types using typedef to create new type names, or enum to define enumeration types with named values.
All data values in Python are encapsulated in relevant object classes. Everything in Python is an object and every object has an identity, a type, and a value. Like another object-oriented language such as Java or C++, there are several data types which are built into Python. Extension modules which are written in C, Java, or other languages can define additional types.
To determine a variable's type in Python you can use the type() function. The value of some objects can be changed. Objects whose value can be changed are called mutable and objects whose value is unchangeable (once they are created) are called immutable.
Python modules allow code reuse and organization. A module is a Python file with a .py extension that contains functions and other objects. Modules can be imported and their contents accessed using dot notation. Modules have a __name__ variable that is set to the module name when imported but is set to "__main__" when the file is executed as a script. Packages are collections of modules organized into directories, with each directory being a package. The Python path defines locations where modules can be found during imports.
This document provides an introduction to the Python programming language. It discusses Python's design philosophy emphasizing readability. It also covers printing messages, reading input, variables and data types, operators, and basic syntax like comments and identifiers. Arithmetic, relational, logical and bitwise operators are explained along with examples.
Python modules allow for code reusability and organization. There are three main components of a Python program: libraries/packages, modules, and functions/sub-modules. Modules can be imported using import, from, or from * statements. Namespaces and name resolution determine how names are looked up and associated with objects. Packages are collections of related modules and use an __init__.py file to be recognized as packages by Python.
How to download and install Python - lesson 2Shohel Rana
We will follow some steps to complete the installation process of Python.
1. Download the Python installer from Python website.
2. By double clicking install it.
3. Set the path for Python
4. Check Python is working very well.
5. If you missed the path setting for Python, then uninstall it and re install Python.
The document discusses object-oriented programming concepts in C#, including defining classes, constructors, properties, static members, interfaces, inheritance, and polymorphism. It provides examples of defining a simple Cat class with fields, a constructor, properties, and methods. It also demonstrates using the Dog class by creating dog objects, setting their properties, and calling their bark method.
This document provides an introduction to Python programming concepts including data types, operators, control flow statements, functions and modules. It discusses the basic Python data types like integers, floats, booleans, strings, lists, tuples, dictionaries and sets. It also covers Python operators like arithmetic, assignment, comparison, logical and identity operators. Additionally, it describes control flow statements like if/else and for loops. Finally, it touches on functions, modules and input/output statements in Python.
This document provides information about dictionaries in Python. It defines dictionaries as mutable containers that store key-value pairs, with keys being unique and values being of any type. It describes dictionary syntax and how to access, update, delete and add elements. It notes that dictionary keys must be immutable like strings or numbers, while values can be any type. Properties of dictionary keys like no duplicate keys and keys requiring immutability are also summarized.
The document discusses various Python datatypes. It explains that Python supports built-in and user-defined datatypes. The main built-in datatypes are None, numeric, sequence, set and mapping types. Numeric types include int, float and complex. Common sequence types are str, bytes, list, tuple and range. Sets can be created using set and frozenset datatypes. Mapping types represent a group of key-value pairs like dictionaries.
The document discusses lists in Python, including how to create, access, modify, loop through, slice, sort, and perform other operations on list elements. Lists can contain elements of different data types, are indexed starting at 0, and support methods like append(), insert(), pop(), and more to manipulate the list. Examples are provided to demonstrate common list operations and functions.
Operator & control statements in C are used to perform operations and control program flow. Arithmetic operators (+, -, *, /, %) are used for mathematical calculations on integers and floating-point numbers. Relational operators (<, <=, >, >=, ==, !=) compare two operands. Logical operators (&&, ||, !) combine conditions. Control statements like if-else, switch, while, for, break, continue and goto alter program execution based on conditions.
An array is a collection of elements of the same type stored in contiguous memory locations that can be accessed using an index. Arrays allow storing multiple values as a single variable. One-dimensional arrays store elements in a list, while multi-dimensional arrays arrange elements in multiple dimensions. Elements are accessed using their position indices, which must be within the array bounds. Arrays can be initialized during declaration and values accessed using loops. Operations like input, output and searching are commonly performed on array elements.
This document discusses random functions in Python. It explains how to import the random module and describes several functions:
- random() generates random float numbers between 0 and 1
- randrange() returns random integers within a given range
- randint() returns random integers within a range similar to randrange()
Examples are provided to demonstrate how to use these functions to generate random numbers between certain values or in lists.
The document discusses key concepts in Java including classes, objects, methods, and command line arguments. A class defines common properties and behaviors for objects through fields and methods. Objects are instantiated from classes and can access fields and methods using dot notation. Command line arguments allow passing data into a Java application and are accessed through the args parameter in the main method.
This document provides an introduction and overview of the Python programming language. It discusses that Python was created by Guido Van Rossum in 1991 and named after Monty Python. Python can be used for both procedural and object-oriented programming approaches. It is an interpreted language that is free to use, easy to learn, and has a simple syntax. Python is popular for web development, data analysis, science/engineering, and more. The document then covers Python syntax and provides examples of using variables, data types, and the interactive mode versus script mode of writing Python code.
Exception handling in Python allows programmers to handle errors and exceptions that occur during runtime. The try/except block handles exceptions, with code in the try block executing normally and code in the except block executing if an exception occurs. Finally blocks ensure code is always executed after a try/except block. Programmers can define custom exceptions and raise exceptions using the raise statement.
Data types in C include primary (fundamental) types like integers and floating-point numbers, as well as derived and user-defined types. Primary types include integers of various sizes (char, short, int, long) that can be signed or unsigned, and floating-point types like float, double, and long double. Integer types have size and value ranges that depend on the machine, such as 8-bit char from -128 to 127. Floating-point types have prescribed sizes and precision levels. User can define their own types using typedef to create new type names, or enum to define enumeration types with named values.
All data values in Python are encapsulated in relevant object classes. Everything in Python is an object and every object has an identity, a type, and a value. Like another object-oriented language such as Java or C++, there are several data types which are built into Python. Extension modules which are written in C, Java, or other languages can define additional types.
To determine a variable's type in Python you can use the type() function. The value of some objects can be changed. Objects whose value can be changed are called mutable and objects whose value is unchangeable (once they are created) are called immutable.
This document provides an overview of the Python programming language tutorial presented over multiple pages. It covers:
1) An introduction to Python, its features, and why it is useful including that it is easy to use, portable, object oriented, and has many standard libraries.
2) An explanation of the different parts of the tutorial covering basic concepts like variables, data types, control structures, functions and exceptions as well as data structures and files.
3) Hands-on examples of using Python's basic types like numbers, strings, lists, tuples and dictionaries along with operations on each and how to use the interactive shell and IDE interfaces.
The document provides an overview of the Python programming language. It discusses what Python is, its history and naming, features like being dynamically typed and interpreted, popular applications like web development, machine learning, and its architecture. It also covers Python constructs like variables, data types, operators, and strings. The document compares Python to other languages and provides examples of common Python concepts.
The document provides an introduction to Python programming. It discusses key concepts like variables, data types, operators, and sequential data types. Python is presented as an interpreted programming language that uses indentation to indicate blocks of code. Comments and documentation are included to explain the code. Various data types are covered, including numbers, strings, booleans, and lists. Operators for arithmetic, comparison, assignment and more are also summarized.
Code In PythonFile 1 main.pyYou will implement two algorithms t.pdfaishwaryaequipment
Code In Python
File 1: main.py
You will implement two algorithms to find the shortest path in a graph.
1. def dijkstra(G,start_node): Takes an Adjacency Matrix G and the index of the starting
node start_node. Returns the distance array.
2. def floyd(G): Takes an Adjacency Matrix G and returns the distance matrix
The graph you are working on will be give in a file with the following format.
1. Line 1: The number of Nodes in the Graph
2. Lines 2-EOF: Every other line in the file contains an edge
1. First Value is the FROM node
2. Second Value is the TO node
3. Third Value is the weight of the edge
Note: You should store the weights as floats.
The program will have a command line interface. First ask for the file name of the graph to work
with. Then implement 4 text commands.
· dijkstra x - Runs Dijkstra starting at node X. X must be an integer
· floyd - Runs Floyd\'s algorithm
· help - prints this menu
· exit or ctrl-D - Exist the program
You must implement this using only standard python3 libraries. You may not use any outside
libraries. For example, open source graph libraries. Your code must run on tux with just main.py
and the input files. You may not include any other python files.
Example Run 1
File containing graph: input1.txt
Possible Commands are:
dijkstra x - Runs Dijkstra starting at node X. X must be an integer
floyd - Runs Floyd\'s algorithm
help - prints this menu
exit or ctrl-D - Exits the program
Enter command: help
Possible Commands are:
dijkstra x - Runs Dijkstra starting at node X. X must be an integer
floyd - Runs Floyd\'s algorithm
help - prints this menu
exit or ctrl-D - Exits the program
Enter command: dijkstra 0
[0.0, 1.0, 3.0, 5.0, 7.0]
Enter command: exit
Bye
Example Run 2
File containing graph: input1.txt
Possible Commands are:
dijkstra x - Runs Dijkstra starting at node X. X must be an integer
floyd - Runs Floyd\'s algorithm
help - prints this menu
exit or ctrl-D - Exits the program
Enter command: dijkstra 0
[0.0, 1.0, 3.0, 5.0, 7.0]
Enter command: dijkstra 1
[inf, 0.0, 2.0, 4.0, 6.0]
Enter command: dijkstra 2
[inf, 3.0, 0.0, 2.0, 4.0]
Enter command: dijkstra 3
[inf, 1.0, 3.0, 0.0, 7.0]
Enter command: dijkstra 4
[inf, 6.0, 8.0, 5.0, 0.0]
Enter command: exit
Bye
Example Run 3
File containing graph: input1.txt
Possible Commands are:
dijkstra x - Runs Dijkstra starting at node X. X must be an integer
floyd - Runs Floyd\'s algorithm
help - prints this menu
exit or ctrl-D - Exits the program
Enter command: floyd
[0.0, 1.0, 3.0, 5.0, 7.0]
[inf, 0.0, 2.0, 4.0, 6.0]
[inf, 3.0, 0.0, 2.0, 4.0]
[inf, 1.0, 3.0, 0.0, 7.0]
[inf, 6.0, 8.0, 5.0, 0.0]
Enter command: exit
Bye
Example Run 4
File containing graph: input2.txt
Possible Commands are:
dijkstra x - Runs Dijkstra starting at node X. X must be an integer
floyd - Runs Floyd\'s algorithm
help - prints this menu
exit or ctrl-D - Exits the program
Enter command: dijkstra 0
[0.0, 3.0, 4.0, 4.0, inf, 4.0]
Enter command: dijkstra 1
[inf, 0.0, 1.0, 3.0, inf, 1.0]
Enter command: dijkst.
Python is a general-purpose programming language that is highly readable. It uses English keywords and has fewer syntactical constructions than other languages. Python supports object-oriented, interactive, and procedural programming. It has various data types like numbers, strings, lists, tuples and dictionaries. Python uses constructs like if/else, for loops, functions and classes to control program flow and structure code.
unit (1)INTRODUCTION TO PYTHON course.pptxusvirat1805
This document provides an introduction to the Python programming language. It discusses what Python is, its history and features. It describes common uses of Python in industries like CIA, Google, Facebook, NASA. It also covers Python building blocks like identifiers, variables, keywords. Additionally, it explains Python data types like numeric, strings, lists, tuples and dictionaries. Finally, it discusses taking input in Python and type casting.
Gurukul Skills Schedule for the Month of March
Time Cohort-10 Cohort-11 Cohort-12
8.00 to 09.25 Revision Revision Revision
5 Minutes Short Break
9.30 to 11.30 Chartered Accountants Chartered Accountants ENGLISH/SOFT SKILLS
15 Minutes Short Break
11.45 to 01.45 ICT ENGLISH/SOFT SKILLS R&A
45 Minutues Lunch Break
2.30 to 04.30 ENGLISH/SOFT SKILLS R&A ICT
15 Minutes Short Break
4.45 to 06.30 R&A ICT ACCOUNTS
5 Minutes Short Break
6.35 to 08.00 Assingments Assingments Assingments
The document discusses installing Python 3 on Ubuntu and Windows systems. It provides step-by-step instructions for installing Python 3.8 using apt on Ubuntu and downloading/running the installer on Windows. Basic Python data visualization techniques like line plots, bar charts, histograms, box plots, and scatter plots are then introduced using the Matplotlib library. Code examples are given for creating each type of plot.
This document provides instructions on installing Python 3 on Ubuntu and Windows operating systems. It discusses installing Python 3.8 on Ubuntu using the apt install command and verifying the installation with the python --version command. It also outlines downloading the Python installer, running the executable, adding Python to environment variables, and verifying the installation on Windows. The document further explains installing iPython using pip and provides examples of using boolean values, conditionals, loops, functions, and strings in Python programs.
This slide includes :
Types of Machine Learning
Supervised Learning
Brain
Neuron
Design a Learning System
Perspectives
Issues in Machine Learning
Learning Task
Learning as Search
Hypothesis
Version Spaces
Candidate elimination algorithm
linear Discriminant
Perception
Linear Separability
Linear Regression
Unsupervised Learning
Reinforcement Learning
Evolutionary Learning
GSM-Mobility Management-Call Control
GRPS-Network elements
Radio Resource Management
Mobility Management and Session Management
Small Screen Web Browsing
UTRAN-Core and Radio Network Mobility Management
UMTS Security
This slide includes
Advanced multiplexing
Code Division Multiplexing
Dense Wavelength Division Multiplexing
OFDM
Connectionless
LAN
L3 SWTICH
SLIP
PPP
CORE AND DISTRIBUTION NETWORKS.
The *nervous system of insects* is a complex network of nerve cells (neurons) and supporting cells that process and transmit information. Here's an overview:
Structure
1. *Brain*: The insect brain is a complex structure that processes sensory information, controls behavior, and integrates information.
2. *Ventral nerve cord*: A chain of ganglia (nerve clusters) that runs along the insect's body, controlling movement and sensory processing.
3. *Peripheral nervous system*: Nerves that connect the central nervous system to sensory organs and muscles.
Functions
1. *Sensory processing*: Insects can detect and respond to various stimuli, such as light, sound, touch, taste, and smell.
2. *Motor control*: The nervous system controls movement, including walking, flying, and feeding.
3. *Behavioral responThe *nervous system of insects* is a complex network of nerve cells (neurons) and supporting cells that process and transmit information. Here's an overview:
Structure
1. *Brain*: The insect brain is a complex structure that processes sensory information, controls behavior, and integrates information.
2. *Ventral nerve cord*: A chain of ganglia (nerve clusters) that runs along the insect's body, controlling movement and sensory processing.
3. *Peripheral nervous system*: Nerves that connect the central nervous system to sensory organs and muscles.
Functions
1. *Sensory processing*: Insects can detect and respond to various stimuli, such as light, sound, touch, taste, and smell.
2. *Motor control*: The nervous system controls movement, including walking, flying, and feeding.
3. *Behavioral responses*: Insects can exhibit complex behaviors, such as mating, foraging, and social interactions.
Characteristics
1. *Decentralized*: Insect nervous systems have some autonomy in different body parts.
2. *Specialized*: Different parts of the nervous system are specialized for specific functions.
3. *Efficient*: Insect nervous systems are highly efficient, allowing for rapid processing and response to stimuli.
The insect nervous system is a remarkable example of evolutionary adaptation, enabling insects to thrive in diverse environments.
The insect nervous system is a remarkable example of evolutionary adaptation, enabling insects to thrive
*Metamorphosis* is a biological process where an animal undergoes a dramatic transformation from a juvenile or larval stage to a adult stage, often involving significant changes in form and structure. This process is commonly seen in insects, amphibians, and some other animals.
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...Celine George
Analytic accounts are used to track and manage financial transactions related to specific projects, departments, or business units. They provide detailed insights into costs and revenues at a granular level, independent of the main accounting system. This helps to better understand profitability, performance, and resource allocation, making it easier to make informed financial decisions and strategic planning.
Multi-currency in odoo accounting and Update exchange rates automatically in ...Celine George
Most business transactions use the currencies of several countries for financial operations. For global transactions, multi-currency management is essential for enabling international trade.
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...larencebapu132
This is short and accurate description of World war-1 (1914-18)
It can give you the perfect factual conceptual clarity on the great war
Regards Simanchala Sarab
Student of BABed(ITEP, Secondary stage)in History at Guru Nanak Dev University Amritsar Punjab 🙏🙏
Understanding P–N Junction Semiconductors: A Beginner’s GuideGS Virdi
Dive into the fundamentals of P–N junctions, the heart of every diode and semiconductor device. In this concise presentation, Dr. G.S. Virdi (Former Chief Scientist, CSIR-CEERI Pilani) covers:
What Is a P–N Junction? Learn how P-type and N-type materials join to create a diode.
Depletion Region & Biasing: See how forward and reverse bias shape the voltage–current behavior.
V–I Characteristics: Understand the curve that defines diode operation.
Real-World Uses: Discover common applications in rectifiers, signal clipping, and more.
Ideal for electronics students, hobbyists, and engineers seeking a clear, practical introduction to P–N junction semiconductors.
How to manage Multiple Warehouses for multiple floors in odoo point of saleCeline George
The need for multiple warehouses and effective inventory management is crucial for companies aiming to optimize their operations, enhance customer satisfaction, and maintain a competitive edge.
GDGLSPGCOER - Git and GitHub Workshop.pptxazeenhodekar
This presentation covers the fundamentals of Git and version control in a practical, beginner-friendly way. Learn key commands, the Git data model, commit workflows, and how to collaborate effectively using Git — all explained with visuals, examples, and relatable humor.
Geography Sem II Unit 1C Correlation of Geography with other school subjectsProfDrShaikhImran
The correlation of school subjects refers to the interconnectedness and mutual reinforcement between different academic disciplines. This concept highlights how knowledge and skills in one subject can support, enhance, or overlap with learning in another. Recognizing these correlations helps in creating a more holistic and meaningful educational experience.
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingCeline George
The Accounting module in Odoo 17 is a complete tool designed to manage all financial aspects of a business. Odoo offers a comprehensive set of tools for generating financial and tax reports, which are crucial for managing a company's finances and ensuring compliance with tax regulations.
In this ppt I have tried to give basic idea about Diabetic peripheral and autonomic neuropathy ..from Levine textbook,IWGDF guideline etc
Hope it will b helpful for trainee and physician
2. Install Python 3 On Ubuntu
Prerequisites
Step 1.A system running Ubuntu
Step 2.A user account with sudo privileges
Step 3.Access to a terminal command-line (Ctrl–Alt–T)
Step 4.Make sure your environment is configured to use
Python 3.8
2
3. Install Python 3
Now you can start the installation of Python 3.8.
$sudo apt install python3.8
Allow the process to complete and verify the Python
version was installed successfully
$python ––version
3
4. Installing and using Python on Windows is very simple.
Step 1: Download the Python Installer binaries
Step 2: Run the Executable Installer
Step 3: Add Python to environmental variables
Step 4: Verify the Python Installation
4
5. Python Installation
Open the Python website in your web browser.
https://www.python.org/downloads/windows/
Once the installer is downloaded, run the Python installer.
Add the following path
C:Program FilesPython37-32: for 64-bit installation
Once the installation is over, you will see a Python Setup
Successful window.
You are ready to start developing Python applications in
your Windows 10 system.
5
6. Introduction
Python is a general-purpose interpreted, interactive, object-
oriented, and high-level programming language.
It was created by Guido van Rossum during 1985- 1990.
Python got its name from “Monty Python’s flying circus”.
Python was released in the year 2000.
Python is interpreted
Python is processed at runtime by the interpreter.
You do not need to compile your program before executing it.
7. Introduction
Python is Interactive: You can actually sit at a Python
prompt and interact with the interpreter directly to write your
programs.
Python is Object-Oriented: Python supports Object-
Oriented style or technique of programming that
encapsulates code within objects.
Python is a Beginner's Language: Python is a great
language for the beginner level programmers and supports
the development of a wide range of applications.
9. Applications
Bit Torrent(a stream flowing with great force) file
sharing
Google search engine, YouTube
Intel, Cisco, HP, IBM
i–Robot
NASA(National Aeronautics and Space Administration)
Facebook, Drop box
10. Applications
Python interpreter:
1.Interpreter
To execute a program in a high-level language by
translating it one line at a time.
2.Compiler
To translate a program written in a high-level language into
a low-level language all at once, in preparation for later
execution.
11. Modes of python interpreter
Python Interpreter is a program that reads and executes
python code. It uses two modes of execution.
1. Interactive mode
2. Script mode
1.Interactive mode
Interactive Mode, as the name suggests, allows us to interact
with operating system.
When we type python statement, interpreter displays the
result(s) immediately.
12. Modes of python interpreter
Advantages:
Python, in interactive mode, is good enough to learn,
experiment or explore.
Working in interactive mode is convenient for beginners
and for testing small pieces of code
Drawback:
We cannot save the statements and have to retype all the
statements once again to re-run them.
In interactive mode, you type python programs and the
interpreter displays the result.
13. Modes of python interpreter
2.Script mode
In script mode, we type python program in a file and then
use interpreter to execute the content of the file.
Scripts can be saved to disk for future use.
Python scripts have the extension .py, meaning that the
filename ends with .py
Save the code with filename.py and run the interpreter in
script mode to execute the script.
14. Integrated Development Learning Environment (IDLE)
It a graphical user interface which is completely written in
python.
It is bundled with the default implementation of the python
language and also comes with optional part of the python
packaging.
Features
Multi-window text editor with syntax highlighting.
Auto completion with smart indentation.
Python shell to display output with syntax highlighting.
15. VALUES AND DATA TYPES
Values
Value can be any letter, number or string.
Values are different data types
Eg: 2, 42.0, and 'Hello, World!'.
Data type
Every value in python has a data type.
It is a set of values, and the allowable operations on those
values.
Python has five standard data types:
16. VALUES AND DATA TYPES
1.Numbers
It stores numerical values.
This data type is immutable (i.e. values/items cannot be changed).
Python supports following number types
1. Integers
2. Floating point numbers
3. Complex numbers.
17. VALUES AND DATA TYPES
1.1Integer
Integers are the whole numbers consisting of positive(+ve) or negative(–
ve) sign.
Integers can be any length, it is only limited by the memory available
Example:
a=10
a=eval(input(“enter a value”))
a=int(input(“enter a value”))
1.2 Float
It has decimal part and fractional part.
It is accurate upto 15 decimal places.
18. VALUES AND DATA TYPES
Example:
a=3.15
a=eval(input(“enter a value”))
a=float(input(“enter a value”))
1.3 Complex
It is a combination of real and imaginary part.
Example:
2+5j
a+bi
19. VALUES AND DATA TYPES
2.Boolean
Boolean data type have two values. It has either 0 or 1.
0 means False
1 means True
True and False is a keyword.
Example:
>>> 3==5
False
>>> True+True
2
>>> False+True
1
>>> False*True
0
20. VALUES AND DATA TYPES
3.Sequence
A sequence is an ordered collection of items, indexed by positive
integers.
It is a combination of mutable (value can be changed) and immutable
(values cannot be changed) data types.
There are three types of sequence data type available in python, they are
1. Strings
2. Lists
3. Tuples
21. VALUES AND DATA TYPES
3.1 Strings
String is defined as a continues set of characters represented in
quotation marks (either single quotes ( ‘ ) or double quotes ( “ ).
An individual character in a string is accessed using a subscript (index).
The subscript should always be an integer (positive or negative).
A subscript starts from 0 to n-1.
Strings are immutable i.e. the contents of the string cannot be changed
after it is created.
Python will get the input at run time by default as a string.
Python does not support character data type. A string of size 1 can
be treated as characters.
22. VALUES AND DATA TYPES
1. single quotes (' ')
2. double quotes (" ")
3. triple quotes(“”” “”””)
Operations on string
1. Indexing
2. Slicing
3. Concatenation
4. Repetitions
5. Member ship
23. VALUES AND DATA TYPES
.
Indexing >>>a=”HELLO”
>>>print(a[0])
>>>H
>>>print(a[1])
>>>O
Positive indexing helps in accessing the
string from the beginning.
Negative subscript helps in accessing the
string from the end.
Slicing
print[0:4] – HELL
print[ :3] – HEL
print[0: ]
HELLO
The slice[n : m] operator extracts sub string
from the strings.
A segment of a string is called a slice.
Concatenation
a=”raj”
b=”man”
print(a+b)
rajman
The + operator joins the text on both sides
of the operator.
Repetitions
a=”welcome ”
print(a*3)
welcome welcome
welcome
The * operator repeats the string on the left
hand side times the value on right hand
side.
Membership
>>> s="good morning"
>>>"m" in
s True
>>> "a" not in
s True
Using membership operators to check a
particular character is in string or not.
Returns true if present
24. VALUES AND DATA TYPES
3.2 Lists
List is an ordered sequence of items. Values in the list are called
elements or items.
Values are separated by commas and enclosed within square
brackets[].
Items in the lists can be different data types.
Lists are mutable(values of list can be changed)
Operations on list
1. Indexing
2. Slicing
3. Concatenation
4. Repetitions
25. VALUES AND DATA TYPES
.create a list
>>> a=[2,3,4,5,6,7,8,9,10]
>>> print(a)
[2, 3, 4, 5, 6, 7, 8, 9, 10]
This is way we can create a list
at compile time
Indexing
>>>print(a[0])
2
>>> print(a[8])
10
>>> print(a[1])
10
Accessing the item in the
position 0
Accessing the item in the
position 8
Accessing a last element
using negative indexing.
Slicing
>>> print(a[0:3])
[2, 3, 4]
>>> print(a[0:])
[2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> print(a[:8])
[2, 3, 4, 5, 6, 7, 8, 9]
Printing a part of the string.
Concatenation
>>>b=[20,30]
>>> print(a+b)
[2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30]
Adding and printing the items of
two lists.
Repetition
>>> print(b*3)
[20, 30, 20, 30, 20, 30]
Create a multiple copies of the
same string.
26. VALUES AND DATA TYPES
. Updating the list
>>> print(a[2])
4
>>> a[2]=100
>>> print(a)
[2, 3, 100, 5, 6, 7, 8, 9, 10]
Updating the list using index
value
Inserting an
element
>>> a. insert(0,“tham")
>>> print(a)
a=[“tham”,2,3,4,5,6,7,8,9,10]
Inserting an element in 0th
position
Removing an
element
>>> a. remove(“tham”)
>>> print(a)
a=[2,3,4,5,6,7,8,9,10]
Removing an element
by giving the element directly
27. VALUES AND DATA TYPES
3.3Tuple
A tuple is an ordered sequence of items same as list.
The set of elements is enclosed in parenthesis instead of square
brackets.
A tuple is an immutable. i.e. cannot be modified.
Tuples are faster than lists.
Tuples can be used as keys in dictionaries.
Tuples are used to write-protect data and cannot be change
dynamically
Tuple have no append or extend method.
Elements can not be removed from a tuple.
28. VALUES AND DATA TYPES
Operations on Tuple
1. Indexing
2. Slicing
3. Concatenation
4. Repetitions
29. VALUES AND DATA TYPES
.
Creating a tuple
>>>a=(20,40,60,”apple”,”ball”)
Creating the tuple with
elements of different data
types.
Indexing
>>>print(a[0])
20
>>> a[2] 60
Accessing the item in the
position 0
Accessing the item in the
position 2
Slicing
>>>print(a[1:3])
(40,60)
Displaying items from 1st till
2nd.
Concatenation
>>> b=(2,4)
>>>print(a+b)
>>>(20,40,60,”apple”,”ball”,2,4)
Adding tuple elements at the
end of another tuple
elements
Repetition
>>>print(b*2)
>>>(2,4,2,4)
repeating the tuple in n no of
times
updating a tuple
>>>a[2]=100
Type Error: 'tuple' object does
not support item assignment
Altering the tuple data type
leads to error.
30. VALUES AND DATA TYPES
4.Dictionaries
Dictionaries are unordered sets.
Dictionary is created by using curly braces. i,e. { }
Dictionaries are accessed via keys.
A dictionary is an associative array. Any key of the
dictionary is associated (or mapped) to a value.
The values of a dictionary can be any Python data type. So
dictionaries are key value-pairs
Dictionaries don't support the sequence data types like
strings, tuples and lists.
31. VALUES AND DATA TYPES
5.Sets
The set datatype is an unordered collection of unique items
The collection is mutable.(i.e. can be add or remove)
Set is defined by value separated by comma inside curly
braces.{}
It has no duplicate entry.
Creating a
dictionary
>>>a={'name':"abi",'age':18,'mark':1
00}
>>>print(a)
{'name': 'abi', 'age': 18, 'mark': 100}
Creating the dictionary
with elements of different
data
types.
Indexing
>>>print(a['name'])
abi
Accessing the item with
keys.
32. VALUES AND DATA TYPES
Example:
a={1,2,3,4,5,6,7,6,7}
print(a)
a={1,2,3,4,5,6,7}
Scalar type
A scalar is a type that can have a single value such as 5,3.14, “THAM”
Example: int, float, complex, boolean and string
Escape sequence
n – move to newline
t – move one tap space horizontally
v – move in space vertically
b – back space
33. VARIABLES
A variable is an identifier that refers to a value
While creating a variable, memory space is reserved in memory
Based on the data type of a variable, the interpreter allocates
memory
The assignment statements are used to create a new variable
and assign values to them.
Variable names can contain letters, underscore and numbers but
do not start with numbers.
Underscore(_) can be used in variable names.
Example:
a=5 // single assignment
a,b,c=2,3,4 // multiple assignment
a=b=c=2 //assigning one value to multiple variables
34. KEYWORDS
Keywords are the reserved words in python.
We cannot use a keyword as variable name, function name or any
other identifier.
They are used to define the syntax and structure of the python
language.
Keywords are case sensitive.
35. IDENTIFIERS
Identifier is the name given to entities like class, functions,
variables etc. in python.
Identifiers can be a combination of letters in lowercase (a to z) or
uppercase (A to Z) or digits (0 to 9) or an underscore (_).
An identifier cannot start with a digit.
Keywords cannot be used as identifiers.
Cannot use special symbols like !, @, #, $, % etc. in our
identifier.
Identifier can be of any length.
Valid Identifiers
num,Num,Num1,_num,num_temp2,IF,Else
Invalid Identifiers
Num 1,num 1,addition of program,1Num,num.no,if,else
36. STATEMENTS
Instructions that a python interpreter can executes are called
statements.
A statement is a unit of code like creating a variable or displaying a
value.
>>> n = 17
>>> print(n)
Here, The first line is an assignment statement that gives a value to n.
The second line is a print statement that displays the value of n.
There are two types of statements available
1. single line statements
2. multi line statements
37. STATEMENTS
1.Single line statements
single line statements are end with newline
Examples:
a=1
b=2
c=a+b
2.Multiline statements
python allows the user to write multi line statement using line
continuation character () to denote that the line should continue.
Example:
total=mark1+
mark2+
mark3
38. INPUT AND OUTPUT
INPUT
Input is a data entered by user in the program.
In python, input () function is available for input.
Syntax:
variable = input (“data”)
Example:
a=input("enter the name:")
Data type Compile time Run time
int a=10 a=int(input(“enter a”))
float a=10.5 a=float(input(“enter a”))
string a=”panimalar” a=input(“enter a string”)
list a=[20,30,40,50] a=list(input(“enter a list”))
tuple a=(20,30,40,50) a=tuple(input(“enter a tuple”))
39. INPUT AND OUTPUT
OUTPUT
An output can be displayed to the user using print statement.
Syntax:
print (expression/constant/variable)
Example:
print ("Hello") // Hello
print(5) //5
print(3+5) //8
print(c)
40. COMMENTS
Comments are used to provide more details about the program like
name of the program, author of the program, date and time, etc.
Types of comments
1. Single line comments
2. Multi line comments
1.Single line comments(#)
A hash sign (#) is the beginning of a comment.
Anything written after # in a line is ignored by interpreter.
Example:
Percentage = (minute * 100) / 60 # calculating percentage of an hour
41. COMMENTS
2.Multi line comments(“””……”””)
Multiple line comments can be written using triple quotes “”” ……….”””
Example:
“”” This program is created by Robert in Dell lab on 12/12/20 based on
newtons method”””
42. LINES AND INDENTATION
Most of the programming languages like C, C++, Java use braces { }
to define a block of code. But, python uses indentation.
Blocks of code are denoted by line indentation.
It is a space given to the block of codes for class and function
definitions or flow control.
Example:
a=3
b=1
if a>b:
print("a is greater")
else:
print("b is greater")
43. TUPLE ASSIGNMENT
A tuple using a single assignment statement.
Python has a very powerful tuple assignment.
Tuple of variables on the left to be assigned values from a tuple on
the right.
The left side is a tuple of variables, the right side is a tuple of values.
Each value is assigned to its respective variable.
All the expressions on the right side are evaluated before any of the
assignments.
(a,b,c)=(3,4,5)
(a, b, c, d) = (1, 2, 3)
ValueError: need more than 3 values to unpack Swapping two
numbers using tuple
(a, b) = (b, a)
44. OPERATORS
An operator is symbol that tells the compiler to perform specific
mathematical or logical manipulations.
Consider the expression 4 + 5 = 9. Here, 4 and 5 are called
operands and + is called operator.
Types of Operators
1. Arithmetic Operators
2. Comparison (Relational) Operators
3. Assignment Operators
4. Logical Operators
5. Bitwise Operators
6. Membership Operators
7. Identity Operators
45. OPERATORS
Arithmetic operators
They are used to perform mathematical operations like addition,
subtraction, multiplication etc.
Operator Description
Example
a=9,b=2
+ Addition Adds values on either side of the operator. a + b = 11
- Subtraction Subtracts operand. Right hand operand from left hand a – b = 7
* Multiplication Multiplies values on either side of the operator a * b = 18
/ Division Divides left hand operand by right hand operand b / a = 4
% Modulus
Divides left hand operand by right hand operand and
returns remainder
b % a = 1
** Exponent
Performs operators exponential (power) calculation on
operators
a**b =9 to the
power 2
//
Floor Division The division of operands where the
result is the quotient in which the digits after the
decimal point are removed
5//2=4.0
46. OPERATORS
Comparison (Relational) Operators
Comparison operators are used to compare values.
It either returns True or False according to the condition.
Operator Description
Example
a=10,b=20
==
If the values of two operands are equal, then the condition becomes
true.
(a == b)
is not true.
!= If values of two operands are not equal, then condition becomes true. (a!=b)
is true
>
If the value of left operand is greater than the value of right operand,
then condition becomes true.
(a > b)
is not true.
<
If the value of left operand is less than the value of right operand,
then condition becomes true.
(a < b)
is true.
>=
If the value of left operand is greater than or equal to the value of
right operand, then condition becomes true.
(a >= b)
is not true.
<=
If the value of left operand is less than or equal to the value of right
operand, then condition becomes true.
(a <= b)
is true.
47. OPERATORS
Assignment Operators
Assignment operators are used in Python to assign values to
variables.
Operator Description Example
=
Assigns values from right side operands to left side
operand.
c = a + b
assigns value of
a + b into c
+= Add AND
It adds right operand to the left operand and assign
the result to left operand
c += a
is equivalent to
c= c + a
= Subtract AND
It subtracts right operand from the left operand and
assign the result to left operand
c = a
is equivalent to
c= c a
*= Multiply AND
It multiplies right operand with the left operand and
assign the result to left operand
c *= a
is equivalent to
c= c * a
/= Divide AND
It divides left operand with the right operand and
assign the result to left operand
c /= a
is equivalent to
c= c / ac
48. OPERATORS
Logical Operators
Logical operators are and, or, not operators.
.
%= Modulus AND
It takes modulus using two operands and assign the
result to left operand
c %= a is
equivalent to c
= c % a
**= Exponent AND
Performs exponential (power) calculation on
operators and assign value to the left operand
c **= a is
equivalent to c
= c ** a
//= Floor Division
It performs floor division on operators and assign
value to the left operand
c //= a is
equivalent to c
= c // a
Operator Meaning Example
and True if both the operands are true x and y
or True if either of the operands is true x or y
not True if operand is false (complements the operand) not x
49. OPERATORS
Bitwise Operators
Bitwise operators act on operands as if they are binary digits. They
operate bit by bit.
Let x = 10 (0000 1010) and y = 4 (0000 0100)
Operator Meaning Example
& Bitwise AND x & y = 0 (0000 0000)
| Bitwise OR x | y = 14 (0000 1110)
~ Bitwise NOT ~x = -11 (1111 0101)
^ Bitwise XOR x ^ y = 14 (0000 1110)
>> Bitwise right shift x >> 2 = 2 (0000 0010)
<< Bitwise left shift x << 2 = 40 (0010 1000)
50. OPERATORS
Membership Operators
Evaluates to find a value or a variable is in the specified sequence
of string, list, tuple, dictionary or not.
Let, x=[5,3,6,4,1]. To check particular item in list or not, in and not in
operators are used.
Example:
x=[5,3,6,4,1]
>>> 5 in x
True
>>> 5 not in x
False
Operator Meaning Example
in True if value/variable is found in the sequence 5 in x
not in
True if value/variable is not found in the
sequence
5 not in x
51. OPERATORS
Identity Operators
They are used to check if two values (or variables) are located on
the same part of the memory.
Example
x = 5
y = 5
a = 'Hello'
b = 'Hello'
print(x is not y) // False
print(a is b)//True
Operator Meaning Example
is True if the operands are identical x is True
is not True if the operands are not identical x is not True
52. Operator Precedence
When an expression contains more than one operator, the order of
evaluation depends on the rules of precedence.
Operator Description
() Parenthesis
** Exponentiation (raise to the power)
~ + - Complement, unary plus and minus
* / % // Multiply, divide, modulo and floor division
+ - Addition and subtraction
>> << Right and left bitwise shift
& Bitwise 'AND'
^ | Bitwise exclusive `OR' and `OR'
<= < > >= Comparison operators
<> == != Equality operators
= %= /= //= -= += *= **= Assignment operators
Is, is not Identity operators
In, not in Membership operators
and,or,not Logical operators
53. Expressions
An expression is a combination of values, variables, and operators.
A value and a variable itself considered as an expression.
The following are all legal expressions:
>>> 42
42
>>> a=2
>>> a+3+2
7
>>> z=("hi"+"friend")
>>> print(z)
hifriend
54. FUNCTIONS
Function is a sub program which consists of set of instructions used
to perform a specific task.
A large program is divided into number of sub program called
function.
Need for Function
When the program is too complex and large they are divided into
sub program.
Each sub program is separately coded and combined into single
program. Each subprogram is called as function.
Debugging, Testing and maintenance becomes easy when the
program is divided into subprograms.
Functions are used to avoid rewriting same code again and again in
a program.
Function provides code re-usability
The length of the program is reduced.
55. FUNCTIONS
TYPES OF FUNCTION
1. Built in function
2. user defined function
1.Built in function
Built in functions are the functions that are already created and
stored in python.
These built in functions are always available for usage and
accessed by a programmer.
It cannot be modified.
56. FUNCTIONS
.
Built in function Description
>>>max(3,4)
4 # returns largest element
>>>min(3,4)
3 # returns smallest element
>>>len("hello")
5 #returns length of an object
>>>range(2,8)
[2, 3, 4, 5, 6, 7] #returns range of given values
>>>round(7.8)
8.0 #returns rounded integer of the given number
>>>chr(5)
x05' #returns a character (a string) from an integer
>>>float(5)
5.0 #returns float number from string or integer
>>>int(5.0)
5 # returns integer from string or float
>>>pow(3,5)
243 #returns power of given number
>>>type( 5.6)
<type 'float'> #returns data type of object to which it belongs
>>>t=tuple([4,6.0,7])
>>>t
(4, 6.0, 7)
# to create tuple of items from list
>>>print("good morning")
Good morning # displays the given object
57. FUNCTIONS
2.User defined function
User defined functions are the functions that programmers create for
their requirement and use.
These functions can then be combined to form module which can be
used in other programs by importing them.
Advantages
The programmer can write their own functions which are known as
user defined function.
These functions can create by using keyword def.
Example:
add(), sub()
Elements of User defined function
There are two elements in user defined function.
1. function definition
2. function call
58. FUNCTIONS
1.Function definition
A function definition specifies the name of a new function and the
sequence of statements that execute when the function is called.
Syntax:
def function name(parameter list): ----Function header
statement 1
statement 2
....
....
statement n
def is a keyword that indicates that this is a function definition.
The rules for function names are the same as for variable names
The first line of the function definition is called the header, the rest is
called body of function.
The header has to end with a colon and the body has to be indented.
The function contains any number of statements.
Parameter list contains list of values used inside the function.
Body of the function
59. FUNCTIONS
Example:
def add():
a=eval(input(“enter a value”))
b=eval(input(“enter a value”))
c=a+b
print(c)
2.Function call()
A function is called by using the function name followed by
parenthesis().
Argument is a list of values provided to the function when the
function is called
The statements inside the function does not executed until the
function is called.
Function can be called n number of times
60. FUNCTIONS
Syntax:
function name(argument list)
Example:
add() or add(a,b)
Flow of Execution
The order in which statements are executed is called the flow of
execution
Program execution starts from first statement.
One statement is executed at a time from top to bottom.
Function definitions do not alter the flow of execution of the program.
The statement inside the function are not executed until the function
is called.
61. FUNCTIONS
When a function is called, the control flow jumps to the body of the
function, execute the statements and return back to the place in the
program where the function call was made.
62. FUNCTION PROTOTYPES
Based on arguments and return type functions are classified into
four types.
1. Function without arguments and without return type
2. Function with arguments and without return type
3. Function without arguments and with return type
4. Function with arguments and with return type
63. FUNCTION PROTOTYPES
1. Function without arguments and without return type
In this type no argument is passed through the function call and no
output is return to main function
The sub function will read the input values perform the operation and
print the result in the same block.
Example
def add():
a=int(input("enter a"))
b=int(input("enter b"))
c=a+b
print(c)
add()
Output:
enter a 5
enter b 10
15
64. FUNCTION PROTOTYPES
2. Function with arguments and without return type
Arguments are passed through the function call but output is not
return to the main function.
Example:
def add(a,b):
c=a+b
print(c)
a=int(input("enter a"))
b=int(input("enter b"))
add(a,b)
OUTPUT:
enter a 5
enter b 10
15
65. FUNCTION PROTOTYPES
3. Function without arguments and with return type
In this type no argument is passed through the function call but
output is return to the main function.
Example:
def add():
a=int(input("enter a"))
b=int(input("enter b"))
c=a+b
return c
c=add()
print(c)
OUTPUT:
enter a 5
enter b 10
15
66. FUNCTION PROTOTYPES
4. Function with arguments and with return type
In this type arguments are passed through the function call and
output is return to the main function.
Example:
def add(a,b):
c=a+b
return c
a=int(input("enter a"))
b=int(input("enter b"))
c=add(a,b)
print(c)
OUTPUT:
enter a 5
enter b 10
15
67. FRUITFUL FUNCTION
Fruitful functions are functions that return value or A function that
yields a return value.
Example:
Root=sqrt(25)
Example:
def add():
a=10
b=20
c=a+b
return c
c=add()
print(c)
68. VOID FUNCTION
Void function is a function that always return none.
It represents the absence of value.
Example:
print("Hello")
Example:
def add():
a=10
b=20
c=a+b
print(c)
add()
69. PARAMETERS AND ARGUMENTS
Parameters
Parameters are the value(s) provided in the function header within
parenthesis.
These are the values required by function to work.
If there is more than one value, separated by comma.
Example: def add(a,b):
Arguments
Arguments are the value(s) provided in function call statement.
List of arguments should be same way as parameters are listed.
Bounding of parameters to arguments is done 1:1, and there should be
same number and type of arguments as mentioned in parameter list.
Example: add(a,b)
70. PARAMETERS AND ARGUMENTS
Return Statement
The return statement is used to exit a function and go back to the place
from where it was called.
If the return statement has no arguments, then it will not return any
values. But exits from function.
Syntax:
return variable
Example:
def add(a,b):
c=a+b
return c
a=5
b=4
c=add(a,b)
print(c)
No Example Description
1 return a return 1 variable
2 return a,b return 2 variables
3 return a,b,c return 3 variables
4 return a+b return expression
5 return 8 return value
71. PARAMETERS AND ARGUMENTS
ARGUMENTS TYPES
You can call a function by using the following types of formal arguments
1. Required arguments
2. Keyword arguments
3. Default arguments
4. Variable-length arguments
1.Required Arguments:
The number of arguments in the function call should match exactly with
the function definition.
72. PARAMETERS AND ARGUMENTS
. Example Output
def student( name, roll ):
print(name,roll)
student("george",98)
George
98
def student( name, roll ):
print(name,roll)
student(101,”rithika”)
101
rithika
def student( name, roll ):
print(name,roll)
student(101)
student() missing 1 required
positional
argument: 'name'
def student( name, roll ):
print(name,roll)
student()
student() missing 2 required
positional
arguments: ‘name' and ‘roll'
73. PARAMETERS AND ARGUMENTS
2.Keyword Arguments
Python interpreter is able to use the keywords provided to match the
values with parameters even though if they are arranged in out of order.
Example Output
def student( name, roll,mark):
print(name,roll,mark)
student (mark=90,roll=102,name="bala")
bala
102
90
def student( name, roll,mark):
print(name,roll,mark)
student (name="bala", roll=102, mark=90)
bala
102
90
74. PARAMETERS AND ARGUMENTS
3.Default Arguments
Assumes a default value if a value is not provided in the function call for
that argument.
It allows us to miss one or more arguments.
Example Output
def student( name="raja", roll=101,mark=50):
print(name,roll,mark)
student (mark=90,roll=102,name="bala")
bala
102
90
def student( name="raja", roll=101,mark=50):
print(name,roll,mark)
student (name="bala", roll=102)
bala
102
90
def student( name="raja", roll=101,mark=50):
print(name,roll,mark)
student ()
raja
101
50
75. PARAMETERS AND ARGUMENTS
4.Variable length Arguments
If we want to specify more arguments than function header parameter,
variable length arguments are used.
It is denoted by * symbol before parameter.
Example Output
def student( name,mark):
print(name,mark)
student (“bala”,90)
bala
90
def student( name, roll,*mark):
print(name,roll,mark)
student ("raja",101,90,80)
raja
101
90
80
76. MODULES
A module is a file containing python definitions, functions,
statements and instructions.
Standard library of python is extended as modules.
Programmer needs to import the module.
Once we import a module, we can use to any of its functions or
variables in our code.
There is large number of standard modules also available in
python.
Standard modules can be imported the same way as import our
user-defined modules.
77. MODULE
Two ways to import your module:
1. import keyword
2. from keyword
1.Import keyword
Import keyword is used to get all functions from the module.
Every module contains many function.
To access one of the function , you have to specify the name of the
module and the name of the function separated by dot .
This format is called dot notation.
Syntax:
import module_name
module_name.function_name(variable)
78. MODULE
Importing built-in module
import math
x=math.sqrt(25)
print(x)
Importing user-defined module
cal.py
def add(a,b):
c=a+b
return c
import cal
x=cal.add(5,4)
print(x)
79. MODULE
2.from keyword
from keyword is used to get only particular function from the module.
Syntax:
from module_name import function_name
#Importing built-in module
from math import sqrt
x=sqrt(25)
print(x)
#Importing user-defined module
from cal import add
x=add(5,4)
print(x)
add.py
def add(a,b):
c=a+b
return c
80. MODULE
2.from keyword
from keyword is used to get only particular function from the module.
Syntax:
from module_name import function_name
#Importing built-in module
from math import sqrt
x=sqrt(25)
print(x)
#Importing user-defined module
from cal import add
x=add(5,4)
print(x)
add.py
def add(a,b):
c=a+b
return c
81. BUILT-IN MODULES
. Built-in Function Description
math.ceil(x)
Return the ceiling of x, the smallest integer
greater than or equal to x
math.floor(x)
Return the floor of x, the largest integer less
than or equal to x.
math.factorial(x) Return x factorial
math.sqrt(x) Return the square root of x
math.log(x) Return the natural logarithm of x
math.log10(x) Returns the base-10 logarithms
math.log2(x) Return the base-2 logarithms
math.sin(x) Returns sin of x radians
math.cos(x) Returns cosine of x radians
82. BUILT-IN MODULES
Generate pseudo-random numbers
Random Function Description
random.randrange(stop) Return random numbers from 0
random.randrange(start, stop[,
step])
Return the random numbers in a range
random.uniform(a, b) Return a random floating point number
83. SAMPLE PROGRAMS
.
Swapping two number Output
a = int(input("Enter a value "))
b = int(input("Enter b value "))
c = a
a = b
b = c
print("a=",a,"b=",b,)
Enter a value 5
Enter b value 8
a=8
b=5
Distance between two points Output
import math
x1=int(input("enter x1"))
y1=int(input("enter y1"))
x2=int(input("enter x2"))
y2=int(input("enter y2"))
distance =math.sqrt((x2-
x1)**2)+((y2-y1)**2)
print(distance)
enter x1 7
enter y1 6
enter x2 5
enter y2 7
2.5
84. SAMPLE PROGRAMS
.
Circulate n numbers Output
a=list(input("enter the list"))
print(a)
for i in range(1,len(a),1):
print(a[i:]+a[:i])
enter the list '1234'
['1', '2', '3', '4']
['2', '3', '4', '1']
['3', '4', '1', '2']
['4', '1', '2', '3']