Lecture One: Introduction to Python PDF
Document Details
Tags
Summary
This document provides an introduction to the Python programming language. It covers concepts like its features, advantages, and applications. The document also contains some questions at the end.
Full Transcript
Lecture - 1 Introduction to Computing Course outline ▪ Introduction to Computing ▪ Introduction to programming ▪ python language. ▪ Jupiter notebook IDLE ▪ Terminal windows ▪ Text editors ▪ Interpreters Introduction to Computing ▪ Computing is the ultimate mental ampl...
Lecture - 1 Introduction to Computing Course outline ▪ Introduction to Computing ▪ Introduction to programming ▪ python language. ▪ Jupiter notebook IDLE ▪ Terminal windows ▪ Text editors ▪ Interpreters Introduction to Computing ▪ Computing is the ultimate mental amplifier. ▪ Automatic computing radically changes how humans solve problems, and even the kinds of problems we can imagine solving. ▪ Computing has changed the world more than any other invention of the past hundred years. ▪ Yet, we are just at the beginning of the computing revolution. Introduction to Computing There are two reasons why everyone should study computing: ✓Nearly all of the most exciting and important technologies, arts, and sciences of today and tomorrow are driven by computing. ✓Understanding computing illuminates deep insights and questions into the nature of our minds, our culture, and our universe. Introduction to Computing Computer is an electronics programmable device that stores, retrieves and processing data. Types of Monitor CRT – Cathode Ray Tube LED – Light Emitting Diode LCD – Liquid Crystal Display What is the difference between Data, Information, & Knowledge? Introduction to Computing Information Processing Cycle are: ✓ Input ✓ Process ✓ Output ✓ Storage ✓ Communication Overview of programming ▪ Computer programming is the process of humans communicating with computers to make them perform specific tasks. ▪ Programming is the process of creating a set of instructions that tell a computer how to perform a task. ▪ Programming involves creating code that Programmers can enter into a computer, application, or software program. ▪ Programming language is a system of notation for writing computer programs. Introduction to Computing: What is Python? ▪ Python is a powerful and versatile programming language that has gained widespread popularity for its simplicity, readability, and wide range of applications. 1 Interpreted Language: Python is an interpreted, high-level programming language, meaning it executes instructions directly without the need for compilation. 2 General-Purpose: Python can be used for a wide variety of applications, from web development and data analysis to machine learning and automation. 3 Open-Source: Python is an open-source language, allowing for a vibrant community of contributors and continuous growth. Introduction to python Why Python? ▪ Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc). ▪ Python has a simple syntax similar to the English language. ▪ Python has syntax that allows developers to write programs with fewer lines than some other programming languages. ▪ Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick. ▪ Python can be treated in a procedural way, an object-oriented way or a functional way. Introduction to Python Programming Origins and Creation of Python 1 1989: Conception: Guido van Rossum begins Python as a hobby project during Christmas holidays. 2 1991: First Release: Python 0.9.0 is released, featuring classes with inheritance and exception handling. 3 1994: Python 1.0: The first major version introduces functional programming tools like lambda, map, and filter. Introduction to Python Programming Original Logo Modern Logo ▪ This is the original Python logo. ▪ The current Python logo. ▪ Designed by Guido van Rossum. ▪ introduced in 2008. ▪ It’s features was a simple ▪ It’s features is a more vibrant illustration of a python snake. and stylized illustration of a python snake. Introduction to Python Programming Early Development and Guido van Rossum 1 Benevolent Dictator For Life: Guido van Rossum leads Python's development, earning the title "BDFL" from the community. 2 Design Philosophy: Van Rossum emphasizes code readability and simplicity in Python's core design principles. 3 Community Building: He fosters an inclusive, collaborative environment that becomes key to Python's success. Introduction to Python Programming Key Features and Design Principles Readability: Python's clean syntax and use of whitespace promote clear, readable code. Versatility: The language supports multiple programming paradigms, from procedural to object-oriented. Extensibility: Python's design allows easy integration with other languages and extensive library support. Introduction to Python Python 1.0 and the Evolution of the Language Python 1.0 (1994): Introduces functional programming tools and modularization features. Python 1.5 (1997): Adds new data types and improves language consistency. Python 1.6 (2000): Introduces Unicode support and enhances the standard library. Introduction to Python Adoption and Growth of the Python Community Open Source: Python's open-source nature fosters a vibrant, collaborative community. Education: Universities and coding bootcamps increasingly adopt Python as a teaching language. Industry Adoption: Major tech companies embrace Python, driving its growth in professional settings. Introduction to Python Python 2.0 and the Shift to Python 3 Feature Python 2 Python 3 Release Year 2000 2008 Print Function Statement Function Unicode Support Limited Full Integer Division Floor Division True Division Introduction to Python Expansion of Python Libraries and Frameworks Data Science Web Development Libraries like NumPy and Django and Flask emerge as Pandas revolutionize data powerful frameworks for analysis and manipulation building web applications. in Python. Machine Learning Scientific Computing TensorFlow and PyTorch SciPy and Matplotlib establish Python as a enhance Python's leader in AI and machine capabilities in scientific learning. and numerical computing. Introduction to Python Python's Rise in Popularity and Diverse Applications Data Analysis Artificial Intelligence Web Development Python becomes the Machine learning and AI Python powers many popular go-to language for research increasingly rely websites and web applications across data scientists and on Python's robust various industries. analysts worldwide. ecosystem. Introduction to Python: Python's Key Features Simplicity ▪ Python's syntax is designed to be easy to read and write. ▪ Making it accessible for beginners and experienced developers alike. Versatility ▪ Python can be used for a wide range of applications. ▪ Like web development, data analysis, machine learning, automation, and more. Extensive Libraries Python has a vast ecosystem of libraries and frameworks that provide pre-built functionality, accelerating development and reducing time-to-market. Python Syntax and Structure 1 Indentation: Python uses indentation to define code blocks, rather than curly braces or other syntax, making the code more readable and maintainable. 2 Variable Assignment: Python uses the assignment operator (=) to assign values to variables, which can hold different data types. 3 Function Definitions: Python functions are defined using the def keyword, followed by the function name and parameters, if any. Data Types and Variables in Python ▪ Numeric: Python supports integer, float, and complex number data types. ▪ String: Python's string data type can store text, including letters, numbers, and special characters. ▪ Boolean: Python's Boolean data type represents true or false values. ▪ List: Python lists are ordered collections of items that can hold different data types. ✓ A list, in Python, is a collection of objects. Introduction to Computing IDLE ▪ Stands for Integrated Development and Learning Environment. ▪ Python IDLE is an integrated development environment (IDE) that's designed for writing and running Python code. ▪ Every Python installation comes with an Integrated Development and Learning Environment. ▪ Is an integrated development environment for Python. Introduction to Computing: Jupiter notebook Interactive ✓Jupiter notebooks allow for interactive coding, execution, and visualization. Data Science ✓Jupiter notebooks are widely used in data science and machine learning. Web-based ✓Jupiter notebooks can be run in a web browser. Introduction to Computing: IDLE Integrated ✓IDLE provides a comprehensive environment for Python development. Beginner-friendly ✓IDLE is a good choice for beginners, as it's easy to use and provides helpful features. Cross-platform ✓IDLE is available for Windows, macOS, and Linux. Introduction to Computing: Terminal windows Command-line interface ✓Terminal windows provide a command-line interface for interacting with your computer. Text-based ✓Terminal windows are text-based and offer a direct way to execute commands. Powerful ✓Terminal windows provide access to a wide range of commands and tools. Introduction to Computing: Text editors Code Editing ✓It provide a basic environment for writing and editing text. ✓A lightweight tools for writing and editing code. File Management ✓They allow you to open, save, and manage files. Keyboard Shortcuts ✓Text editors typically offer numerous keyboard shortcuts for efficiency. Introduction to Computing: Interpreters Code Execution ✓Interpreters translate code into machine instructions. Line by Line ✓Interpreters execute code line by line. Dynamic Typing ✓Interpreters handle data types at runtime. Getting started with Python: installation and setup Download Python ✓ Visit python.org and download the latest version for your operating system. Install Python ✓ Run the installer and follow the setup wizard. Don't forget to add Python to PATH. Verify Installation ✓ Open a command prompt and type 'python --version' to confirm successful installation. Key features of Python Readable Syntax ✓ Python's clean, indentation-based syntax enhances code readability and reduces errors. Rich Libraries ✓ Extensive standard library and third-party packages support diverse programming tasks. Cross-Platform ✓ Python runs on various operating systems, ensuring code portability and flexibility. Introduction to Computing Advantages of IDLE ▪ Simplicity: Easy to learn and use. ▪ Integrated Features: Provides editor, debugger, and shell in one environment. ▪ Debugging Tools: IDLE doesn't easily support customization or plugin extensions. Disadvantages of IDLE ▪ Limited Features: lacks of features like code completion, as compared to advanced IDEs. ▪ Performance Issues: IDLE can be slow with large projects. ▪ Lack of Extensibility: IDLE doesn't easily support customization or plugin extensions. Introduction to Python The Future of Python and Emerging Trends 1 Python 4.0 2 Quantum Computing Anticipation builds for the next major Python libraries for quantum version, promising enhanced computing gain traction, opening performance and features. new frontiers in computation. 3 Edge Computing 4 Sustainability Python's role in IoT and edge The community focuses on making computing continues to grow and Python more energy-efficient for evolve. large-scale applications. Python coding learning resources Online Python learning platforms and courses Coursera, Udemy ✓Offers university-partnered Python courses for various skill levels. Codecademy ✓Provides interactive Python lessons with hands-on coding practice. edX ✓Features Python courses from top institutions, including certification options. https://www.youtube.com/results?search_query=freecodecamp+p ython Questions 1. How to choose the right python IDLE? 2. List major application areas of python. 3. Why python? 4. What is the difference between python and other programming languages? 5. Why python is popular? 6. Compare python programming with other programming languages. 7. Write the procedures to install and run your python code. How to earn money using programming? Some online business areas are: https://www.upwork.com/ https://www.fiverr.com/ https://www.freelance.com/ https://www.guru.com/ https://www.turing.com/