1tle.pdf
Document Details
Holy Angel University
Tags
Full Transcript
Getting Started With PYTHON Jose O. Zepeda, LPT TLE 10 – Programming Holy Angel University PYTHON is an interpreted, object-oriented, high level programming language. it has high-level, built-in data structures with dynamic typing and b...
Getting Started With PYTHON Jose O. Zepeda, LPT TLE 10 – Programming Holy Angel University PYTHON is an interpreted, object-oriented, high level programming language. it has high-level, built-in data structures with dynamic typing and binding. it’s syntax is easy to learn. it’s interpreter and standard library are available without charge. it increases the programmers’ productivity. there is no compilation step the edit-test-debug cycle is fast and effective 2 History of Python ✓It was conceptualized in the late 1980s by Guido van Rossum. ✓He published the first version of Python code (version 0.9.0) at alt.sources in February 1991. ✓Python version 1.0 was released in January 1994. ✓In October 2000, Python 2.0 was introduced. ✓In 2008, Python 3.0 was released. 3 Features of Python ❖It is simple and minimalistic language. - allows us to concentrate on the solution to the problem rather than the syntax (i.e., the language itself.) ❖It is extremely easy to get started. ❖It is free and open-source. - read the software source code, make changes to it and use its pieces in other programs ❖It is a high – level language. - no need to bother about low-level details like managing the memory used. ❖It is portable. - it works on many platforms like Linux, Windows, Macintosh, Solaris, PlayStation, and many more. 4 Features of Python ❖It is an interpreted language. - no separate compilation and execution steps - run the program from the source code - no need to worry about linking, loading with libraries, etc. ❖It supports procedure-oriented programming. - supports object-oriented programming, especially when compared to languages like C++ or Java. ❖It is extensible. - if need a critical piece of code to run very fast, just write that piece of code in C, and then combining that with our Python program. 5 Features of Python ❖It cab be embedded within our C/C++ program. - it gives scripting capabilities to our program’s users. ❖It has an extensive standard library. - regular expressions, documentation generation, unit testing, threading, databases, web browsers, etc. – always available wherever Python is installed. ❖It is an exciting and powerful language. - has the right combination of performances and features that makes writing programs in Python both fun and easy. 6 Python Applications Graphical User Interface(GUI)-based desktop applications Desirable choice for developing desktop-based applications (image processing & graphic design apps, scientific & computational apps, & games) Web frameworks and web applications Used to create a variety of web frameworks that provide standard libraries and modules. Enterprise and business applications Suitable coding language for customizing larger applications Operating systems An integral part of Linux distributions. Language development It’s design and module architecture has influenced the development of numerous languages like Apple’s Swift, CoffeeScript, Cobra, and Ocaml. Prototyping Preferred choice for prototype development 7 How to Download and Install Python? 1) Go to download Python page on the official site: www.python.org. 8 How to Download and Install Python? 2) Click the download Python 3.10.1 9 How to Download and Install Python? 3)When the download is complete, double-click the file and follow the instructions to install it. Note: When Python is installed, a program called IDLE is also installed. It provides a graphical user interface to work with Python. 10 How to Download and Install Python? 4) Open IDLE from the Taskbar IDLE – Integrated Development and Learning Environment. - It allows programmers to easily write Python code. - It can be used to execute a single statement and create, modify, and execute Python scripts. 11 How to Download and Install Python? 4.1) Copy the print (“Hello, World.”) code below and press the Enter key. HELLO, WORLD is a simple program that when run displays the message Hello, World. It has been the new programmer’s induction into a myriad of programming languages. 12 How to Download and Install Python? 4.2) To create a File in IDLE, go to File > New File Shortcut: Ctrl + N 13 How to Download and Install Python? 5) Type the Python code and save Ctrl + S with.py file extension. 14 How to Download and Install Python? 5) Type the Python code and save Ctrl + S with.py file extension. ❑ We may create a New Folder for all our Python Files. We save this folder wherein it could be retrieved easily. ❑ We may save it as hello.py or my-first-program.py. ❑ Save it in a folder where we keep all our Python files 15 How to Download and Install Python? 6) Go to Run > Run Module Shortcut: F5 to see the output. 16 17