This document provides an introduction to the Python programming language. It begins with an overview of Python's history and development timeline. It then discusses Python's key features such as being high-level, interpreted, object-oriented, and having extensive libraries. The document outlines Python's main programming paradigms and discusses its growing popularity. It provides details on getting started with Python, different integrated development environments (IDEs), and Python basics like variables, data types, operators, and input/output. The document also covers Python syntax and structures such as control flow, functions, classes, and exceptions handling.
YouTube Link: https://youtu.be/WvhQhj4n6b8
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'What is Python?' will help you understand and learn python programming language with its features. It is one of the most widely adopted programming language in the industry currently. Below are the topics covered in this Python Programming tutorial
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
Python is a widely-used and powerful computer programming language that has helped system administrators manage computer networks and problem solve computer systems for decades. Python has also built some popular applications like BitTorrent, Blender, Calibre, Dropbox, and much more. Going further, the “Pi” in Raspberry Pi stands for Python, so learning Python will instill more confidence when working with Raspberry Pi projects. Python is usually the first programming language people learn primarily because it is easy to learn and provides a solid foundation to learn other computer programming languages. In this webinar,
• Learn what Python is and what it is capable of doing.
• Install Python’s IDE for Windows and work in the Python shell.
• Use calculations, variables, strings, lists, and if statements.
• Discover Python’s built-in functions and understand modules.
• Create simple programs to build on later.
The recording is available at https://youtu.be/ThcWmJFf-ho.
Python, the Language of Science and Engineering for EngineersBoey Pak Cheong
A talk given in November 2016 at IEM Malaysia to engineers, who are new to Python, a broad perspective of what Python is, why it is important to learn it and how it can help in solving/visualization of engineering and scientific tasks and problems.
this presentation will walk you through basic introduction to python, major features of python, how python runs on our system and some important commands used in python.
(1) Python uses indentation rather than braces to indicate blocks of code for functions and control flow. All statements within a block must be indented the same amount.
(2) Python identifiers can consist of letters, numbers, and underscores but must start with a letter or underscore. Identifiers are case-sensitive.
(3) There are reserved words in Python that cannot be used as identifiers such as def, if, else, and, or, not, etc.
Python is an interpreted programming language created by Guido van Rossum in 1991. It has an elegant syntax, large standard library, and is used widely for data science, machine learning, web development, and more. Key Python libraries for data analysis include NumPy, pandas, and matplotlib. Pandas allows importing and cleaning data from files like CSVs, and matplotlib can be used to visualize and present analyzed data. For example, a program can use pandas to read baby name data from a CSV, find the most popular name with the highest birth count, and plot the results to clearly present the findings.
The document discusses Bram Cohen's view that Python is a good language for maintainability as it has clean syntax, object encapsulation, good library support, and optional parameters, and then provides details about the history and features of the Python programming language such as being dynamically typed, having a large standard library, and being cross-platform.
YouTube Link: https://youtu.be/WvhQhj4n6b8
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'What is Python?' will help you understand and learn python programming language with its features. It is one of the most widely adopted programming language in the industry currently. Below are the topics covered in this Python Programming tutorial
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
Python is a widely-used and powerful computer programming language that has helped system administrators manage computer networks and problem solve computer systems for decades. Python has also built some popular applications like BitTorrent, Blender, Calibre, Dropbox, and much more. Going further, the “Pi” in Raspberry Pi stands for Python, so learning Python will instill more confidence when working with Raspberry Pi projects. Python is usually the first programming language people learn primarily because it is easy to learn and provides a solid foundation to learn other computer programming languages. In this webinar,
• Learn what Python is and what it is capable of doing.
• Install Python’s IDE for Windows and work in the Python shell.
• Use calculations, variables, strings, lists, and if statements.
• Discover Python’s built-in functions and understand modules.
• Create simple programs to build on later.
The recording is available at https://youtu.be/ThcWmJFf-ho.
Python, the Language of Science and Engineering for EngineersBoey Pak Cheong
A talk given in November 2016 at IEM Malaysia to engineers, who are new to Python, a broad perspective of what Python is, why it is important to learn it and how it can help in solving/visualization of engineering and scientific tasks and problems.
this presentation will walk you through basic introduction to python, major features of python, how python runs on our system and some important commands used in python.
(1) Python uses indentation rather than braces to indicate blocks of code for functions and control flow. All statements within a block must be indented the same amount.
(2) Python identifiers can consist of letters, numbers, and underscores but must start with a letter or underscore. Identifiers are case-sensitive.
(3) There are reserved words in Python that cannot be used as identifiers such as def, if, else, and, or, not, etc.
Python is an interpreted programming language created by Guido van Rossum in 1991. It has an elegant syntax, large standard library, and is used widely for data science, machine learning, web development, and more. Key Python libraries for data analysis include NumPy, pandas, and matplotlib. Pandas allows importing and cleaning data from files like CSVs, and matplotlib can be used to visualize and present analyzed data. For example, a program can use pandas to read baby name data from a CSV, find the most popular name with the highest birth count, and plot the results to clearly present the findings.
The document discusses Bram Cohen's view that Python is a good language for maintainability as it has clean syntax, object encapsulation, good library support, and optional parameters, and then provides details about the history and features of the Python programming language such as being dynamically typed, having a large standard library, and being cross-platform.
This document discusses programming languages, compilers vs interpreters, and introduces Python. It explains that a programming language communicates instructions to a machine and can be used to create programs. An interpreter reads and executes code directly, while a compiler converts source code into machine code. Python is an interpreted, object-oriented language that is easy to learn yet powerful. It can be used for web, enterprise, and other applications. The document also provides basic information on Python syntax and data types.
The document provides information about the Python programming language. It discusses that Python is an interpreted, interactive, and object-oriented language well-suited for beginners. It provides details on Python's history and development as well as an overview of its core features like a broad standard library, portability, extensibility, support for databases, and an interactive mode. The document also describes how to get Python, run Python code through an interactive interpreter or script, and use integrated development environments. It covers basic programming concepts in Python like arithmetic, decision making with if/else statements, loops, lists, and functions.
Python is a popular programming language created by Guido van Rossum in 1991. It is easy to use, powerful, and versatile, making it suitable for beginners and experts alike. Python code can be written and executed in the browser using Google Colab, which provides a Jupyter notebook environment and access to computing resources like GPUs. The document then discusses installing Python using Anaconda, basic Python concepts like indentation, variables, strings, conditionals, and loops.
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'Introduction To Python' will help you establish a strong hold on all the fundamentals in the Python programming language. Below are the topics covered in this PPT:
Introduction To Python
Keywords And Identifiers
Variables And Data Types
Operators
Loops In Python
Functions
Classes And Objects
OOPS Concepts
File Handling
YouTube Video: https://youtu.be/uYjRzbP5aZs
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
This document provides an overview of Python programming concepts including the basics of Python, strings, control structures like if/else statements and loops, and input/output functions. It discusses what a program and programming are, gives an introduction to Python including its uses and installation. It then covers key Python concepts like variables, data types, operators, functions, modules and object-oriented programming.
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.
Python is a popular programming language introduced in 1991 by Guido van Rossum. It can be used for web development, software development, mathematics, and system scripting. The document discusses basics of Python including flow charts, algorithms, installing Python IDLE, and using variables in Python to store data values.
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAMaulik Borsaniya
Introduction to Python:
The basic elements of Python, Objects, expressions and numerical Types, Variables and assignments, IDLE, Branching programs, Strings and Input, Iteration
Structured Types, Mutability and Higher-order Functions:
Tuples, Lists and Mutability, Functions as Objects, Strings, Tuples and Lists, Dictionaries
Python is a general purpose programming language that can be used for both programming and scripting. It was created in the late 1980s by Guido van Rossum to address the limitations of other languages at the time. Python code is first compiled to bytecode, which is then executed by the Python Virtual Machine. It is an easy to use, powerful, and portable language employed by many major companies for web development, system administration, science, and more.
Python tutorial for beginners - Tib academyTIB Academy
Get python training through simple tutorial from TIB Academy, through this python tutorial you can lean more topics of python. you can download python tutorial free as PPT
The document provides an introduction to Python programming by discussing statements and syntax. It covers assignment statements, expression statements, print operations, conditional statements like if/else, and loop statements like while and for. It explains how Python programs are composed of modules containing statements with expressions. Truth tests for conditionals and built-in functions like range, zip that can be used in loops are also overviewed.
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.
Youtube Link: https://youtu.be/woVJ4N5nl_s
** Python Certification Training: https://www.edureka.co/data-science-python-certification-course **
This Edureka PPT on 'Python Basics' will help you understand what exactly makes Python special and covers all the basics of Python programming along with examples.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
This document discusses key concepts in Python programming including data types, operators, strings, modules, object-oriented programming, and connecting to SQLite databases. It provides examples of numeric, boolean, and sequence data types. It also demonstrates various math operators, string operators like concatenation and multiplication, and how to import and use modules. Object-oriented concepts like classes, attributes, and behaviors are explained using a parrot example. Finally, it mentions how to connect a SQLite database to Python code using the MySQLdb interface.
This document introduces a Python programming course taught by Ghulam Mustafa Shoro at the University of Sindh. The course covers Python programming theory and lab work. It meets once a week for theory and once a week for lab. The textbook used is "Python for Everybody". The course aims to teach basic Python programming and covers chapters 1-5 of the textbook. Upon completing the course, students will be prepared for more advanced Python courses.
Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python's simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed.
Provides an introductory level understanding of the Python Programming Language and language features. Serves as a guide for beginners and a reference to Python basics and language use cases.
Best Python Online Training with Live Project by Expert QA TrainingHub
QA Training Hub is best Python Programing Online Training Center in India. Python Online Training provided by real time working Professional Mr. Dinesh. Data Scientist and RPA Expert with 18+ years of industry experience in teaching Python. Visit: http://www.qatraininghub.com/python-online-training.php Contact: Mr. Dinesh Raju : India: +91-8977262627, USA: : +1-845-493-5018, Mail: info@qatraininghub.com
Introduction about Python by JanBask Training, we are offering Online Pyton Training. You should visit: http://www.janbasktraining.com/python/ for Pyton Training.
This document discusses programming languages, compilers vs interpreters, and introduces Python. It explains that a programming language communicates instructions to a machine and can be used to create programs. An interpreter reads and executes code directly, while a compiler converts source code into machine code. Python is an interpreted, object-oriented language that is easy to learn yet powerful. It can be used for web, enterprise, and other applications. The document also provides basic information on Python syntax and data types.
The document provides information about the Python programming language. It discusses that Python is an interpreted, interactive, and object-oriented language well-suited for beginners. It provides details on Python's history and development as well as an overview of its core features like a broad standard library, portability, extensibility, support for databases, and an interactive mode. The document also describes how to get Python, run Python code through an interactive interpreter or script, and use integrated development environments. It covers basic programming concepts in Python like arithmetic, decision making with if/else statements, loops, lists, and functions.
Python is a popular programming language created by Guido van Rossum in 1991. It is easy to use, powerful, and versatile, making it suitable for beginners and experts alike. Python code can be written and executed in the browser using Google Colab, which provides a Jupyter notebook environment and access to computing resources like GPUs. The document then discusses installing Python using Anaconda, basic Python concepts like indentation, variables, strings, conditionals, and loops.
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'Introduction To Python' will help you establish a strong hold on all the fundamentals in the Python programming language. Below are the topics covered in this PPT:
Introduction To Python
Keywords And Identifiers
Variables And Data Types
Operators
Loops In Python
Functions
Classes And Objects
OOPS Concepts
File Handling
YouTube Video: https://youtu.be/uYjRzbP5aZs
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
This document provides an overview of Python programming concepts including the basics of Python, strings, control structures like if/else statements and loops, and input/output functions. It discusses what a program and programming are, gives an introduction to Python including its uses and installation. It then covers key Python concepts like variables, data types, operators, functions, modules and object-oriented programming.
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.
Python is a popular programming language introduced in 1991 by Guido van Rossum. It can be used for web development, software development, mathematics, and system scripting. The document discusses basics of Python including flow charts, algorithms, installing Python IDLE, and using variables in Python to store data values.
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAMaulik Borsaniya
Introduction to Python:
The basic elements of Python, Objects, expressions and numerical Types, Variables and assignments, IDLE, Branching programs, Strings and Input, Iteration
Structured Types, Mutability and Higher-order Functions:
Tuples, Lists and Mutability, Functions as Objects, Strings, Tuples and Lists, Dictionaries
Python is a general purpose programming language that can be used for both programming and scripting. It was created in the late 1980s by Guido van Rossum to address the limitations of other languages at the time. Python code is first compiled to bytecode, which is then executed by the Python Virtual Machine. It is an easy to use, powerful, and portable language employed by many major companies for web development, system administration, science, and more.
Python tutorial for beginners - Tib academyTIB Academy
Get python training through simple tutorial from TIB Academy, through this python tutorial you can lean more topics of python. you can download python tutorial free as PPT
The document provides an introduction to Python programming by discussing statements and syntax. It covers assignment statements, expression statements, print operations, conditional statements like if/else, and loop statements like while and for. It explains how Python programs are composed of modules containing statements with expressions. Truth tests for conditionals and built-in functions like range, zip that can be used in loops are also overviewed.
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.
Youtube Link: https://youtu.be/woVJ4N5nl_s
** Python Certification Training: https://www.edureka.co/data-science-python-certification-course **
This Edureka PPT on 'Python Basics' will help you understand what exactly makes Python special and covers all the basics of Python programming along with examples.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
This document discusses key concepts in Python programming including data types, operators, strings, modules, object-oriented programming, and connecting to SQLite databases. It provides examples of numeric, boolean, and sequence data types. It also demonstrates various math operators, string operators like concatenation and multiplication, and how to import and use modules. Object-oriented concepts like classes, attributes, and behaviors are explained using a parrot example. Finally, it mentions how to connect a SQLite database to Python code using the MySQLdb interface.
This document introduces a Python programming course taught by Ghulam Mustafa Shoro at the University of Sindh. The course covers Python programming theory and lab work. It meets once a week for theory and once a week for lab. The textbook used is "Python for Everybody". The course aims to teach basic Python programming and covers chapters 1-5 of the textbook. Upon completing the course, students will be prepared for more advanced Python courses.
Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python's simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed.
Provides an introductory level understanding of the Python Programming Language and language features. Serves as a guide for beginners and a reference to Python basics and language use cases.
Best Python Online Training with Live Project by Expert QA TrainingHub
QA Training Hub is best Python Programing Online Training Center in India. Python Online Training provided by real time working Professional Mr. Dinesh. Data Scientist and RPA Expert with 18+ years of industry experience in teaching Python. Visit: http://www.qatraininghub.com/python-online-training.php Contact: Mr. Dinesh Raju : India: +91-8977262627, USA: : +1-845-493-5018, Mail: info@qatraininghub.com
Introduction about Python by JanBask Training, we are offering Online Pyton Training. You should visit: http://www.janbasktraining.com/python/ for Pyton Training.
web programming UNIT VIII python by Bhavsingh MalothBhavsingh Maloth
This document provides a tutorial on Python programming. It introduces core Python concepts over several sections. The first section discusses what will be covered, including an introduction to the Python language and becoming comfortable writing basic programs. Subsequent sections cover specific Python topics like data types, operators, conditional and loop execution, functions, modules and packages for code reusability. The document emphasizes consistent indentation and readability in Python code.
The document discusses a lesson on data wrangling in Python. It covers basics of Python like its history, versions, and features. It also discusses data types in Python like numeric, string, and sequence types. Specifically, it covers integers, floats, strings, lists and operations on sequences like strings and lists. The document provides instructions on installing Miniconda and Jupyter Lab as well as examples of Python code for hello world, variables, and operations. The next week's lesson will cover dictionaries and control statements.
Python is a popular programming language created in 1991 by Guido van Rossum. It can be used for web development, software development, mathematics, and system scripting. Python code can be executed immediately as it is written due to its interpreter system, allowing for quick prototyping. It works across different platforms and has a simple, English-like syntax. Common data types in Python include numeric, string, list, and tuple types.
This is the presentation I used to teach the first class of Python SIG (Special Interest Group) which is a class for interested students taught by students. This is not meant to be used as standalone material, rather, it is meant to point you in a useful direction. If you are new to Python, and know another programming language, I hope this will be helpful to you.
The document provides an overview of the basics of the Python programming language. It discusses that Python is an interpreted, interactive, object-oriented scripting language. It also covers Python's history and describes it as being easy to learn and read, easy to maintain, portable, and extensible. The document then details Python's core data types including numbers, strings, lists, tuples, and dictionaries. It provides examples of how to define and manipulate variables of each data type in Python.
This tutorial provides an introduction to the Python programming language. It will cover Python's core features like syntax, data types, operators, conditional and loop execution, functions, modules and packages to enable writing basic programs. The tutorial is intended for learners to learn Python together through questions, discussions and pointing out mistakes.
Python is an interpreted, interactive, object-oriented programming language. It has a simple syntax and is used for rapid application development. Python supports procedural, object-oriented, and functional programming. It has a large standard library and can connect to existing components. Python is easy to read and maintain due to its clear syntax and structure. It is also portable and has broad library support.
This document provides information about Jupyter Notebook, including:
- Jupyter Notebook is an open-source web application for creating and sharing documents containing live code, equations, visualizations, and narrative text.
- It works locally on localhost port 8888 and the easiest way to install it is through Anaconda which includes Jupyter Notebook and popular Python libraries.
- Notebooks use kernels to run code in different programming languages, with IPython being the default Python kernel.
The document provides an introduction to Python programming, including details about Python's history, versions, data types, strings, and code execution. It discusses how to install Python and write basic programs. Key reasons for using Python are its object-oriented nature, readability, large standard library, cross-platform capabilities, and ease of use. The document also covers string methods and slicing, numeric data types, installing Python, and running code in interactive and script modes.
This document provides an overview and introduction to Python programming. It discusses Python basics like variables, data types, operators, conditionals, loops, functions and file handling. It also covers commonly used Python libraries and concepts in data analytics like NumPy, Pandas, Matplotlib and statistics. The document is intended as a whistle-stop tour to cover the most common aspects of Python.
This is an introduction to python ppt. This PPT has basic information about python. This may be first-class to the learner. It describes the fundamentals of python from history to basic programming skills. It allows the learner to learn how to start coding in python
The document provides an introduction to Python programming. It discusses that Python is a high-level, interpreted, object-oriented, and general purpose programming language. It can be used for web development, scientific computing, desktop applications, and more. The document then covers Python basics like data types, variables, literals, operators, control flow statements, functions, modules and packages. It also discusses installing Python on Windows and writing the first Python program.
This document provides a high-level summary of an introduction to Python programming course. The summary includes an overview of Python basics like variables, data types, operators, conditionals, loops, functions and file handling. It also discusses commonly used Python libraries and concepts in data analytics like NumPy, Pandas, Matplotlib and statistics.
Java is an important programming language for three main reasons:
1) It allows for portability of programs across different operating systems and hardware with its write once, run anywhere capability.
2) The emergence of the World Wide Web in the 1990s demanded portable programs, which necessitated the invention of Java.
3) Java's portability and security features made it well-suited for developing applications for the web.
This document provides an overview of Python programming in Katana for beginners. It discusses scripting languages and their advantages, different programming paradigms like procedural and object-oriented programming, and key Python concepts like data types, variables, functions, modules and packages. The document also demonstrates how to get started with Python in Katana, covering topics like syntax, comments, writing scripts and using the interactive console.
The document provides an introduction to Python programming including its features, uses, history, and installation process. Some key points covered include:
- Python is an interpreted, object-oriented programming language that is used for web development, scientific computing, and desktop applications.
- It was created by Guido van Rossum in 1991 and named after the Monty Python comedy group.
- To install Python on Windows, users download the latest version from python.org and run the installer, which also installs the IDLE development environment.
- The document then covers basic Python concepts like variables, data types, operators, and input/output functions.
Introduction to Analytics with Azure Notebooks and PythonJen Stirrup
Introduction to Analytics with Azure Notebooks and Python for Data Science and Business Intelligence. This is one part of a full day workshop on moving from BI to Analytics
This document provides an introduction to Python programming language. It discusses what Python is, its features, applications, and how it compares to compiled languages in terms of compiling versus interpreting. It also covers installing Python, different Python environments like the Python shell, IDLE, Jupyter Notebook, and Anaconda. Basic Python concepts like variables, data types, operators, functions, modules, and math module commands are explained. The reader is instructed to install NumPy and SciPy using conda for the next lab and test the installations.
Similar to An Introduction to Python Programming (20)
ANTLR educational slides. The slides provide a simple introduction to ANTLR, a parser generator and a language application development framework.
By Morteza Zakeri.
ANTLR educational slides. The slides provide a simple introduction to ANTLR, a parser generator and a language application development framework.
By Morteza Zakeri.
ANTLR educational slides. The slides provide a simple introduction to ANTLR, a parser generator and a language application development framework.
By Morteza Zakeri.
IUST Advanced software engineering course by Dr. Saeed Parsa. Credits of slides belong to Dr. Saeed Parsa and IUST reverse engineering research laboratory. All slides are available publicly due to COVID 19 Pandemic.
IUST Advanced software engineering course by Dr. Saeed Parsa. Credits of slides belong to Dr. Saeed Parsa and IUST reverse engineering research laboratory. All slides are available publicly due to COVID 19 Pandemic.
IUST Advanced software engineering course by Dr. Saeed Parsa. Credits of slides belong to Dr. Saeed Parsa and IUST reverse engineering research laboratory. All slides are available publicly due to COVID 19 Pandemic.
IUST Advanced software engineering course by Dr. Saeed Parsa. Credits of slides belong to Dr. Saeed Parsa and IUST reverse engineering research laboratory. All slides are available publicly due to COVID 19 Pandemic.
IUST Advanced software engineering course by Dr. Saeed Parsa. Credits of slides belong to Dr. Saeed Parsa and IUST reverse engineering research laboratory. All slides are available publicly due to COVID 19 Pandemic.
IUST Advanced software engineering course by Dr. Saeed Parsa. Credits of slides belong to Dr. Saeed Parsa and IUST reverse engineering research laboratory. All slides are available publicly due to COVID 19 Pandemic.
IUST Advanced software engineering course by Dr. Saeed Parsa. Credits of slides belong to Dr. Saeed Parsa and IUST reverse engineering research laboratory. All slides are available publicly due to COVID 19 Pandemic.
IUST Advanced software engineering course by Dr. Saeed Parsa. Credits of slides belong to Dr. Saeed Parsa and IUST reverse engineering research laboratory. All slides are available publicly due to COVID 19 Pandemic.
IUST Advanced software engineering course by Dr. Saeed Parsa. Credits of slides belong to Dr. Saeed Parsa and IUST reverse engineering research laboratory. All slides are available publicly due to COVID 19 Pandemic.
This document describes the architectural design of SpotifyX, a framework for applications like Spotify. It includes an introduction and outlines the key features, architectural blueprints using the 4+1 view model, and logical class diagrams for some of the main microservices - media streaming, search, and recommendation. The document is presented as part of a university course on software architectures.
SQLite and object-relational mapping in JavaMorteza Zakeri
This document provides an introduction to using object-relational mapping (ORM) with SQLite in Java. It discusses the advantages of ORM and object-oriented programming. It then covers installing the SQLite ORM library, connecting to a database, and performing basic CRUD operations like create, read, update, and delete using both the ORM and equivalent SQL statements. The key benefits of ORM like reduced development time and improved maintainability are highlighted.
Apache Mesos: Architecture, Design and Code ReviewMorteza Zakeri
This document provides an overview of the Apache Mesos distributed systems framework. It discusses Mesos' architecture for sharing computer clusters between multiple frameworks like Hadoop and MPI. Mesos uses a master-slave model with the master offering resources to frameworks, which can then launch tasks on slave nodes. The document reviews Mesos' design decisions, implementation in C++, strengths like modularity, and weaknesses like some duplicate abstractions. It also analyzes Mesos' source code structure and identifies areas for design improvement.
The CBC machine is a common diagnostic tool used by doctors to measure a patient's red blood cell count, white blood cell count and platelet count. The machine uses a small sample of the patient's blood, which is then placed into special tubes and analyzed. The results of the analysis are then displayed on a screen for the doctor to review. The CBC machine is an important tool for diagnosing various conditions, such as anemia, infection and leukemia. It can also help to monitor a patient's response to treatment.
Advanced control scheme of doubly fed induction generator for wind turbine us...IJECEIAES
This paper describes a speed control device for generating electrical energy on an electricity network based on the doubly fed induction generator (DFIG) used for wind power conversion systems. At first, a double-fed induction generator model was constructed. A control law is formulated to govern the flow of energy between the stator of a DFIG and the energy network using three types of controllers: proportional integral (PI), sliding mode controller (SMC) and second order sliding mode controller (SOSMC). Their different results in terms of power reference tracking, reaction to unexpected speed fluctuations, sensitivity to perturbations, and resilience against machine parameter alterations are compared. MATLAB/Simulink was used to conduct the simulations for the preceding study. Multiple simulations have shown very satisfying results, and the investigations demonstrate the efficacy and power-enhancing capabilities of the suggested control system.
International Conference on NLP, Artificial Intelligence, Machine Learning an...gerogepatton
International Conference on NLP, Artificial Intelligence, Machine Learning and Applications (NLAIM 2024) offers a premier global platform for exchanging insights and findings in the theory, methodology, and applications of NLP, Artificial Intelligence, Machine Learning, and their applications. The conference seeks substantial contributions across all key domains of NLP, Artificial Intelligence, Machine Learning, and their practical applications, aiming to foster both theoretical advancements and real-world implementations. With a focus on facilitating collaboration between researchers and practitioners from academia and industry, the conference serves as a nexus for sharing the latest developments in the field.
Embedded machine learning-based road conditions and driving behavior monitoringIJECEIAES
Car accident rates have increased in recent years, resulting in losses in human lives, properties, and other financial costs. An embedded machine learning-based system is developed to address this critical issue. The system can monitor road conditions, detect driving patterns, and identify aggressive driving behaviors. The system is based on neural networks trained on a comprehensive dataset of driving events, driving styles, and road conditions. The system effectively detects potential risks and helps mitigate the frequency and impact of accidents. The primary goal is to ensure the safety of drivers and vehicles. Collecting data involved gathering information on three key road events: normal street and normal drive, speed bumps, circular yellow speed bumps, and three aggressive driving actions: sudden start, sudden stop, and sudden entry. The gathered data is processed and analyzed using a machine learning system designed for limited power and memory devices. The developed system resulted in 91.9% accuracy, 93.6% precision, and 92% recall. The achieved inference time on an Arduino Nano 33 BLE Sense with a 32-bit CPU running at 64 MHz is 34 ms and requires 2.6 kB peak RAM and 139.9 kB program flash memory, making it suitable for resource-constrained embedded systems.
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...IJECEIAES
Medical image analysis has witnessed significant advancements with deep learning techniques. In the domain of brain tumor segmentation, the ability to
precisely delineate tumor boundaries from magnetic resonance imaging (MRI)
scans holds profound implications for diagnosis. This study presents an ensemble convolutional neural network (CNN) with transfer learning, integrating
the state-of-the-art Deeplabv3+ architecture with the ResNet18 backbone. The
model is rigorously trained and evaluated, exhibiting remarkable performance
metrics, including an impressive global accuracy of 99.286%, a high-class accuracy of 82.191%, a mean intersection over union (IoU) of 79.900%, a weighted
IoU of 98.620%, and a Boundary F1 (BF) score of 83.303%. Notably, a detailed comparative analysis with existing methods showcases the superiority of
our proposed model. These findings underscore the model’s competence in precise brain tumor localization, underscoring its potential to revolutionize medical
image analysis and enhance healthcare outcomes. This research paves the way
for future exploration and optimization of advanced CNN models in medical
imaging, emphasizing addressing false positives and resource efficiency.
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...shadow0702a
This document serves as a comprehensive step-by-step guide on how to effectively use PyCharm for remote debugging of the Windows Subsystem for Linux (WSL) on a local Windows machine. It meticulously outlines several critical steps in the process, starting with the crucial task of enabling permissions, followed by the installation and configuration of WSL.
The guide then proceeds to explain how to set up the SSH service within the WSL environment, an integral part of the process. Alongside this, it also provides detailed instructions on how to modify the inbound rules of the Windows firewall to facilitate the process, ensuring that there are no connectivity issues that could potentially hinder the debugging process.
The document further emphasizes on the importance of checking the connection between the Windows and WSL environments, providing instructions on how to ensure that the connection is optimal and ready for remote debugging.
It also offers an in-depth guide on how to configure the WSL interpreter and files within the PyCharm environment. This is essential for ensuring that the debugging process is set up correctly and that the program can be run effectively within the WSL terminal.
Additionally, the document provides guidance on how to set up breakpoints for debugging, a fundamental aspect of the debugging process which allows the developer to stop the execution of their code at certain points and inspect their program at those stages.
Finally, the document concludes by providing a link to a reference blog. This blog offers additional information and guidance on configuring the remote Python interpreter in PyCharm, providing the reader with a well-rounded understanding of the process.
2. Contents at a Glance
• What is Python?
• History and Timeline
• Python 2 and 3
• Philosophy
• Key Features
• Paradigms
• Popularity
• Getting Started
• IDLE IDE
• First Program
• Other IDEs
• Python Basics
• Variables and Data Types
• Operators
• Type Conversion
• Syntax and Structures
• Input / Output
• Identifiers
• lines
• Block and Indentation
• Quotations
• Comments
5-Jan-15 2 of 75Intro. To Python [Morteza Zakeri – University of Arak]
3. Contents at a Glance
• Control Flow
• Composite Types
• Lists
• Tuples
• Ranges
• Dictionaries
• Functions
• Definitions and Calling
• Nested Functions
• First-Class Objects
• Object-Oriented Python
• Classes
• Inheritance
• Garbage Collection
• Be Pythonic!
• Summary
• References
5-Jan-15 3 of 75Intro. To Python [Morteza Zakeri – University of Arak]
4. What is Python?
• Python is a widely-used general purpose
(both industry and academia) high-level
Programming language.
• It combines the power of systems
languages, such as C and Java, with the
ease and rapid development of scripting
languages, such as Ruby.
5-Jan-15 4 of 75Intro. To Python [Morteza Zakeri – University of Arak]
5. History and Timeline
• Python Invented by Guido van Rossum
in1991 at CWI in the Netherlands.
• Python reached version 1.0 in January
1994. The major new features included in
this release were the functional
programming tools.
Van Rossum
Born: 31 January 1956 (age 58)
5-Jan-15 5 of 75Intro. To Python [Morteza Zakeri – University of Arak]
6. History and Timeline
• Python 1.0 - January 1994
• Python 1.5 - December 31, 1997
• Python 1.6 - September 5, 2000
• Python 2.0 - October 16, 2000
• Python 2.1 - April 17, 2001
• Python 2.2 - December 21, 2001
• Python 2.3 - July 29, 2003
• Python 2.4 - November 30, 2004
• Python 2.5 - September 19, 2006
• Python 2.6 - October 1, 2008
• Python 2.7 - July 3, 2010
• Python 3.0 - December 3, 2008
• Python 3.1 - June 27, 2009
• Python 3.2 - February 20, 2011
• Python 3.3 - September 29, 2012
• Python 3.4 - March 16, 2014
5-Jan-15 6 of 75Intro. To Python [Morteza Zakeri – University of Arak]
7. Python 2 and 3
• Python 2.0 was released in 2000, with many new features
added.
• Python 3.0, adjusting several aspects of the core
language, was released in 2008.
• Python 3.0 is backwards-incompatible.
• Codes written for Python 2.x may not work under 3.x!
• Python 2.x is legacy, Python 3.x is the present and future of
the language.
5-Jan-15 7 of 75Intro. To Python [Morteza Zakeri – University of Arak]
8. Language Philosophy
• Beautiful is better than ugly
• Explicit is better than implicit
• Simple is better than complex
• Complex is better than complicated
• Flat is better than nested
• Sparse is better than dense
5-Jan-15 8 of 75Intro. To Python [Morteza Zakeri – University of Arak]
9. Key Features
• Simple and Minimalistic
• Easy to Learn
• High-level Language
• Portable
• Interpreted
• Embeddable
• Extensive Libraries
• Free, Open Source, … and Fun!
5-Jan-15 9 of 75Intro. To Python [Morteza Zakeri – University of Arak]
10. Programming Paradigms
• Python is a multi paradigm programming language.
• Imperative
• Functional
• Object-Oriented
• Aspect-Oriented
• Logic (rule base) Programming (by extension)
• …
5-Jan-15 10 of 75Intro. To Python [Morteza Zakeri – University of Arak]
11. 5-Jan-15 11 of 75Intro. To Python [Morteza Zakeri – University of Arak]
12. • Top 10
Programming
Languages.
• IEEE Spectrum’s
2014 Ranking.
Popularity
Infographic:
Brandon Palacio
http://spectrum.ieee.org
5-Jan-15 12 of 75Intro. To Python [Morteza Zakeri – University of Arak]
13. Getting Started
• There are three different ways to start Python
1. Interactive Interpreter
• from Unix, Linux, DOS, etc.
• Python shell begin with >>>
2. Script from the Command-line
• Install python.
• python [YourScriptFileName.py]
3. Integrated Development Environment (IDE)
• You can run Python from a graphical user interface (GUI) environment.
• All in One solution like IDLE in next slide.
5-Jan-15 13 of 75Intro. To Python [Morteza Zakeri – University of Arak]
14. Getting Started
• IDLE IDE
• Download Python from
http://python.org
• Install it.
• Run it.
5-Jan-15 14 of 75Intro. To Python [Morteza Zakeri – University of Arak]
16. Simple Script with Output
5-Jan-15 16 of 75Intro. To Python [Morteza Zakeri – University of Arak]
17. Other IDEs: PyDev
• PyDev is a Python
IDE for Eclipse
• http://pydev.org/
5-Jan-15 17 of 75Intro. To Python [Morteza Zakeri – University of Arak]
18. Other IDEs: Visual Studio
5-Jan-15 18 of 75Intro. To Python [Morteza Zakeri – University of Arak]
19. Python Basics: Objects and Variables
• In python everything is an object.
• So a variable is an object.
• A variable is name given to a memory location to store
value in the computer’s main storage.
5-Jan-15 19 of 75Intro. To Python [Morteza Zakeri – University of Arak]
20. Python Basics: Objects and Variables
• Every object / Variable has three components:
1. Identity
• Object’s address in memory does not change once it has been created.
2. Type (or Class)
• A set of values and the allowable operations on those values exist for each
type.
• Type of type is type!!!
3. Value
• To bind value to a variable using assignment operator ( = ), for example:
• x = 12345
5-Jan-15 20 of 75Intro. To Python [Morteza Zakeri – University of Arak]
21. Python Basics: Objects and Variables
• Python is a dynamically typed language, so:
• Use Late Binding (run time binding).
• No need to declare variable before binding a value.
• Any given variable can have its value altered at any time!
5-Jan-15 21 of 75Intro. To Python [Morteza Zakeri – University of Arak]
22. Primitive Data Types
• Python has some standard types that are used to define
the operations possible on them and the storage method
for each of them.
5-Jan-15 22 of 75Intro. To Python [Morteza Zakeri – University of Arak]
26. Type Conversion
• Python has strong typing language (unlike JavaScript)
• We need to use type converter functions:
5-Jan-15 26 of 75Intro. To Python [Morteza Zakeri – University of Arak]
27. Syntax and Semantic: Simplicity
• Python syntax is simple, simple, simple!!!
• Full python grammar (BNF) is less than 120 line!
• There are less than 35 keywords in python.
5-Jan-15 27 of 75Intro. To Python [Morteza Zakeri – University of Arak]
28. Syntax and Semantic: Powerfully
Simple Swap in Java: Simple Swap in Python:
5-Jan-15 28 of 75Intro. To Python [Morteza Zakeri – University of Arak]
29. Input and Output
Script to calculate circle area: Output:
5-Jan-15 29 of 75Intro. To Python [Morteza Zakeri – University of Arak]
30. Identifiers
• A Python identifier is a name used to identify a variable,
function, class, module, or other object.
• An identifier starts with a letter A to Z or a to z or an
underscore (_) followed by zero or more letters,
underscores, and digits (0 to 9).
• Python does not allow punctuation characters such as @,
$, and % within identifiers.
• Python is a case sensitive programming language. Thus
Var and var are two different identifiers in Python.
5-Jan-15 30 of 75Intro. To Python [Morteza Zakeri – University of Arak]
31. Lines
• Single-Line Statements
• Statements in Python typically end with a new line.
• Multi-Line Statements
• character ‘’ use to denote that the line should continue.
5-Jan-15 31 of 75Intro. To Python [Morteza Zakeri – University of Arak]
32. Lines
• Statements contained within the [ ], { }, or ( ) brackets do not
need to use the line continuation character. For example:
• line containing only whitespace, possibly with a comment, is
known as a blank line, and Python totally ignores it.
5-Jan-15 32 of 75Intro. To Python [Morteza Zakeri – University of Arak]
33. Lines
• Multiple Statements on a Single Line
• The semicolon ( ; ) allows multiple statements on the single line.
• Multiple Statement Groups called Suites
• Groups of individual statements making up a single code block
are called suites.
• Compound or complex statements, such as “if”, “while”, “def”,
and “class”, are those which require a header line and a suite.
5-Jan-15 33 of 75Intro. To Python [Morteza Zakeri – University of Arak]
34. Blocks and Indentations
• Blocks begin with colon mark ( : )
• Nested blocks are allowed.
• Line Indentation use to determine blocks scope!
• The number of spaces in the indentation is variable, but all
statements within the block must be indented the same amount
• pass keyword use to fill empty or not implementation
blocks body.
• pass ≡ do nothing
5-Jan-15 34 of 75Intro. To Python [Morteza Zakeri – University of Arak]
35. Quotations
• Python accepts single ('), double (") and triple (''' or """)
quotes to denote string literals, as long as the same type
of quote starts and ends the string.
• The triple quotes can be used to span the string across
multiple lines.
5-Jan-15 35 of 75Intro. To Python [Morteza Zakeri – University of Arak]
36. Comments
• A hash sign (#) that is not inside a string literal begins a
comment.
• All characters after the # and up to the physical line end
are part of the comment, and the Python interpreter
ignores them.
5-Jan-15 36 of 75Intro. To Python [Morteza Zakeri – University of Arak]
37. Control Flow: Conditions
• Like other languages, Python has if and else statements
• Python’s “else-if” is spelled elif
5-Jan-15 37 of 75Intro. To Python [Morteza Zakeri – University of Arak]
38. Control Flow: Conditions
• Python has an easy to use if-syntax for setting the value of
a variable!
5-Jan-15 38 of 75Intro. To Python [Morteza Zakeri – University of Arak]
39. Truth and Falsity Value Testing
• Any object can be tested for truth value, for use in a
condition.
• False:
1. None (≡ 𝑛𝑢𝑙𝑙)
2. False (Python >= 2.2.1)
3. Zero of any numeric type, e.g., 0, 0.0, 0j
4. Any empty sequence or dictionary, e.g., ‘ ‘, ( ), [ ], { }
• True:
• Everything else
5-Jan-15 39 of 75Intro. To Python [Morteza Zakeri – University of Arak]
40. Control Flow: Loops
• While loop
• The while loop continues to execute the same body of code until
the conditional statement is no longer True.
• We can use break and continue inside the loops
5-Jan-15 40 of 75Intro. To Python [Morteza Zakeri – University of Arak]
41. Control Flow: Loops
• For loop
• The for loop in Python is much simpler that other C-like
languages.
• We can use range() function to produce a list of numbers.
5-Jan-15 41 of 75Intro. To Python [Morteza Zakeri – University of Arak]
42. Sequence Types
• There are three basic sequence types:
• lists
• Tuples
• range objects
• Additional sequence types include:
• Strings (str)
• Binary Data (bytes, bytearray, memoryview)
5-Jan-15 42 of 75Intro. To Python [Morteza Zakeri – University of Arak]
43. Sequence Types
• Sequence types are very like together.
• All of them consist of iterables objects.
• There are some difference:
• Lists are mutable, heterogeneous.
• Tuple are immutable, heterogeneous.
• Ranges are immutable, homogeneous.
• String are immutable, homogeneous.
• Immutable ≡ 𝐶𝑎𝑛′
𝑡 𝑢𝑠𝑒 𝑎𝑠 𝑙 − 𝑣𝑎𝑙𝑢𝑒
5-Jan-15 43 of 75Intro. To Python [Morteza Zakeri – University of Arak]
44. Lists
• Lists are similar to arrays in C. One difference between
them is that all the items belonging to a list can be of
different data type.
• [] – an empty list.
• [6] – an one-element list.
• [5, 1+2j, ’hello’] - a 3-element list (heterogeneous).
• [[1,2], [3,4], [5,6]] - a list of lists.
5-Jan-15 44 of 75Intro. To Python [Morteza Zakeri – University of Arak]
45. Lists
• Lists may be constructed in several ways:
• Using a pair of square brackets to denote the empty list:
• L = []
• Using square brackets, separating items with commas:
• L = [a] or L = [a, b, c]
• Using a list comprehension:
• L = [x for x in iterable]
• Using the type constructor:
• L = list() or L = list(iterable)
5-Jan-15 45 of 75Intro. To Python [Morteza Zakeri – University of Arak]
46. list comprehension
• A compact way to process all or part of the elements in a
sequence and return a list with the results.
• result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]
• generates a list of strings containing even hex numbers (0x..) in
the range from 0 to 255.
• The if clause is optional. If omitted, all elements in range(256) are
processed.
5-Jan-15 46 of 75Intro. To Python [Morteza Zakeri – University of Arak]
47. Tuples
• A tuple is another sequence data type that is similar to the
list.
• A tuple consists of a number of values separated by
commas.
• The main differences between lists and tuples are:
• Lists are enclosed in brackets ( [ ] ), and their elements and size
can be changed, while tuples are enclosed in parentheses ( ( ) )
and cannot be updated.
• Tuples can be thought of as read-only lists.
5-Jan-15 47 of 75Intro. To Python [Morteza Zakeri – University of Arak]
48. Tuples
• Tuples may be constructed in a number of ways:
• Using a pair of parentheses to denote the empty tuple:
• T = ()
• Using a trailing comma for a singleton tuple:
• T= 1, or T = (1,)
• Separating items with commas:
• a, b, c or (a, b, c)
• Using the tuple() built-in:
• T = tuple() or T = tuple(iterable)
5-Jan-15 48 of 75Intro. To Python [Morteza Zakeri – University of Arak]
49. Ranges
• The range type represents an immutable sequence of
numbers and is commonly used for looping a specific
number of times in for loops.
• The advantage of the range type over a regular list or
tuple is that a range object will always take the same
(small) amount of memory, no matter the size of the range
it represents (as it only stores the start, stop and step
values, calculating individual items and subranges as
needed).
5-Jan-15 49 of 75Intro. To Python [Morteza Zakeri – University of Arak]
52. Dictionaries
• Python's dictionaries are hash table type. They work like
associative arrays in Perl and consist of key-value pairs.
• Keys can be almost any Python type, but are usually numbers
or strings. Values, on the other hand, can be any arbitrary
Python object.
• Dictionaries are enclosed by curly braces ( { } ) and values can
be assigned and accessed using square braces ( [] ).
• Dictionaries have no concept of order among elements. It is
incorrect to say that the elements are “out of order”; they are
simply unordered.
5-Jan-15 52 of 75Intro. To Python [Morteza Zakeri – University of Arak]
54. Functions
• Function objects are created by function definitions. The
only operation on a function object is to call it:
• function-name(argument-list).
• There are really two flavors of function objects:
• built-in functions
• user-defined functions.
• Both support the same operation (to call the function), but
the implementation is different, hence the different object
types.
5-Jan-15 54 of 75Intro. To Python [Morteza Zakeri – University of Arak]
55. Methods
• Method is a function defined in a class namespace.
• There are two flavors:
• built-in methods (such as append() on lists)
• class instance methods.
• Built-in methods are described with the types that support
them.
5-Jan-15 55 of 75Intro. To Python [Morteza Zakeri – University of Arak]
56. Define Functions
• Function blocks begin with the keyword def followed by the
function name and parentheses.
• The first statement of a function can be an optional statement
- the documentation string of the function or docstring.
• The code block within every function starts with a colon ( : )
and is indented.
• The statement return [expression] exits a function, optionally
passing back an expression to the caller. A return statement
with no arguments is the same as return None.
5-Jan-15 56 of 75Intro. To Python [Morteza Zakeri – University of Arak]
58. Arguments Passing
• Pass by reference vs value
• All parameters (arguments) in the Python language are passed
by reference.
• If you change what a parameter refers to within a function, the
change also reflects back in the calling function.
• If you assigned new value to parameter by assign operation (=),
new reference will be created (call by value!!!)
• So python provide two semantic by one syntax in function
calling!!!
5-Jan-15 58 of 75Intro. To Python [Morteza Zakeri – University of Arak]
61. Arguments Types
• You can call a function by using the following types of
formal arguments:
• Required arguments
• Keyword arguments
• Default arguments
• Variable-length arguments
5-Jan-15 61 of 75Intro. To Python [Morteza Zakeri – University of Arak]
63. Nested Functions
• Function scopes (and class scopes) can be nested.
• Python using static scope.
• Inner function can’t access to variables reference exist in
outer function but R-Value allowed!
• nonlocal keyword use to access outer variables so
dynamic scope will provide!!!
5-Jan-15 63 of 75Intro. To Python [Morteza Zakeri – University of Arak]
65. First-Class Objects
• Almost everything (including functions, classes, etc) in
Python is a first-class object!
5-Jan-15 65 of 75Intro. To Python [Morteza Zakeri – University of Arak]
67. Object-Oriented Python
• Python support object-oriented (class and objects)
• Python support multiple inheritance
5-Jan-15 67 of 75Intro. To Python [Morteza Zakeri – University of Arak]
69. Destroying Objects (Garbage Collection)
• Allocating and freeing memory is not your problem!
• Python uses reference counting.
• An object's reference count increases when it's assigned a
new name or placed in a container (list, tuple, etc). The
object's reference count decreases when it's deleted with
del.
• When an object's reference count reaches zero, Python
collects it automatically.
5-Jan-15 69 of 75Intro. To Python [Morteza Zakeri – University of Arak]
71. Alternative Python Implementations
• CPython: Traditional implementation of Python that we
used in this introduction.
• IronPython: Python running on .NET
• Jython: Python running on the Java Virtual Machine (JVM)
• PyPy: A fast python implementation with a just in-time (JIT)
compiler.
• More:
• https://www.python.org/download/alternatives
5-Jan-15 71 of 75Intro. To Python [Morteza Zakeri – University of Arak]
72. Famous Apps. written in python
• Dropbox: A web-based file hosting service
• BitTorrent: original client, along with several derivatives.
• Ubuntu Software Center: A graphical package manager,
installed by default in Ubuntu 9.10 and higher.
• More:
• http://en.wikipedia.org/wiki/List_of_Python_software
5-Jan-15 72 of 75Intro. To Python [Morteza Zakeri – University of Arak]
73. Summary
• Python is
• High-Level
• Multi-Paradigm
• and has
• Dynamic Type
• Strong Type
• and use
• Call by Reference(and value)
• Static (and Dynamic) Scope
5-Jan-15 73 of 75Intro. To Python [Morteza Zakeri – University of Arak]
74. Reference
1. Python Official Website
• http://python.org/
2. Python 3 Documentation
• http://docs.python.org/3/
3. Python Tutorials
• http://www.tutorialspoint.com/python/
4. Learning Python, Fifth Edition
• Mark Lutz, Published by O’Reilly Media, Inc. 2013
5-Jan-15 74 of 75Intro. To Python [Morteza Zakeri – University of Arak]
75. Thank you for your attention.
Slides will available on:
• http://micropedia.ir/python