Discover millions of ebooks, audiobooks, and so much more with a free trial

From $11.99/month after trial. Cancel anytime.

Python Made Easy: A First Course in Computer Programming Using Python
Python Made Easy: A First Course in Computer Programming Using Python
Python Made Easy: A First Course in Computer Programming Using Python
Ebook363 pages2 hours

Python Made Easy: A First Course in Computer Programming Using Python

Rating: 0 out of 5 stars

()

Read preview
LanguageEnglish
Release dateAug 21, 2024
ISBN9781836646143
Python Made Easy: A First Course in Computer Programming Using Python
Author

Kevin Wilson

Kevin Wilson is the New York Times bestselling author of five novels, including Now Is Not the Time to Panic, Nothing to See Here, and The Family Fang, as well as two story collections. His work has received the Shirley Jackson Award and been selected as a Read with Jenna book club pick. He lives in Sewanee, Tennessee, with his wife and two sons.

Read more from Kevin Wilson

Related to Python Made Easy

Related ebooks

Programming For You

View More

Reviews for Python Made Easy

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Python Made Easy - Kevin Wilson

    About the Author

    With over 20 years’ experience in the computer industry, Kevin Wilson has made a career out of technology and showing others how to use it. After earning a master’s degree in computer science, software engineering, and multimedia systems, Kevin has held various positions in the IT industry including graphic & web design, programming, building & managing corporate networks, and IT support.

    He serves as senior writer and director at Elluminet Press Ltd, he periodically teaches computer science at college, and works as an IT trainer in England while researching for his PhD. His books have become a valuable resource among the students in England, South Africa, Canada, and in the United States.

    Kevin’s motto is clear: If you can’t explain something simply, then you haven’t understood it well enough. To that end, he has created the Exploring Tech Computing series, in which he breaks down complex technological subjects into smaller, easy-to-follow steps that students and ordinary computer users can put into practice.

    Acknowledgements

    Thanks to all the staff at Luminescent Media & Elluminet Press for their passion, dedication and hard work in the preparation and production of this book.

    To all my friends and family for their continued support and encouragement in all my writing projects.

    To all my colleagues, students and testers who took the time to test procedures and offer feedback on the book

    Finally thanks to you the reader for choosing this book. I hope it helps you gain a better understanding of Python Programming.

    Have fun!

    Getting Started

    The aim of this book is to provide a first course in the use of a methodical and effective approach to the development of computer programs using the Python Programming Language.

    Chapters have been deliberately kept short with a learn by doing approach. Along the way, you’ll find various video tutorials and demonstrations you can access using the various links throughout the book.

    Chapter by chapter, we’ll explore the ins and outs of Python with illustrations, worked examples, lab exercises and projects for you to complete yourself. For this purpose, we’ve included all the source code for this book in the following repository:

    elluminetpress.com/python2

    Have Fun!

    What is Python

    Python is a high-level programming language created by Guido van Rossum and first released in 1991. The name Python was inspired by Guido’s love for the British comedy series Monty Python’s Flying Circus.

    Python emphasizes code readability and aims to provide a clear and concise syntax, making it easier for programmers to express concepts and ideas in fewer lines of code compared to other programming languages. There is also a comprehensive library that provides a wide range of built in modules and functions for common programming tasks. This philosophy encourages the reuse of existing code and reduces the need for developers to rely heavily on third-party libraries for basic functionalities. Over the years, Python has attracted a large community of developers who contribute to its extensive ecosystem of third-party libraries and frameworks, further expanding its capabilities.

    Python is designed to be a versatile language and is widely used in web development, data analysis, artificial intelligence, scientific computing, and automation.

    Installing Python

    In this section, we’ll take a look at how to install the python interpreter and development environment.

    Python has multiple versions available, such as Python 2.x and Python 3.x. It is recommended to install the latest stable version, which is Python 3.x. Python 2.x is no longer actively supported, and most new projects and libraries are designed for Python 3.x.

    You can install python on Windows, Mac, or linux.

    Install on Windows

    In our lab, we’re using windows workstations, so we’ll need to install the Python Development Environment for Windows.

    Open your web browser and navigate to the following website:

    www.python.org/downloads/windows

    From the downloads page, select the ‘executable installer’ of latest stable release.

    Click ‘run’ when prompted by your browser. Or click ‘python-x.x.x-amd64.exe’ if you’re using Chrome.

    Once the installer starts, make sure ‘add python 3.x to path’ is selected, then click ‘customize installation’ to run through the steps to complete the installation.

    Make sure you select all the tick boxes for all the optional features. Click ‘next’.

    Make sure ‘install for all users’ is selected at the top of the dialog box. Click ‘install’ to begin.

    Click ‘disable path length limit’ to make sure Python runs smoothly on Windows and allow long file names.

    Click ‘close’ to finish the installation.

    You’ll find the Python Development Environment (IDLE) and the Python interpreter, in the Python folder on your start menu.

    Install on MacOS

    To install Python 3 with the Official Installer, open your web browser and navigate to the following website

    www.python.org/downloads/macos

    Click download python.

    You’ll find the package in your downloads folder. Double click on the package to begin the installation

    Run through the installation wizard. Click ‘continue’.

    Once the installation is complete, you’ll find python in the applications folder in finder, or on the launch pad.

    Install on Linux

    If you are running a linux distribution such as Ubuntu or have a Raspberry Pi, you can install python using the terminal. You’ll find the terminal app in your applications. You can also press Control Alt T on your keyboard.

    At the terminal command prompt, type the following commands. Press enter after each line.

    sudo apt update

    sudo apt upgrade

    Type the following command to install Python.

    sudo apt install python3 -y

    Once the Python is installed, we need to install IDLE, the development environment. To do this, type the following command at the prompt

    sudo apt-get install idle3 -y

    Once installed, you’ll find IDLE in your applications.

    Or you can type the following command at the prompt

    idle

    Setting up a Development Environment

    A good development environment enhances productivity by providing features such as code editing, debugging, and testing capabilities.

    There are several code editors and Integrated Development Environments (IDEs) available for Python programming. Once you have installed the python interpreter as discussed above, you should install a code editor or IDE. What you choose is personal preference and depends on the specific requirements of your project.

    Try a few difference ones until you find the one that suits your needs the best.

    Code Editor vs IDE

    A code editor is a lightweight tool focused primarily on editing code. It provides features such as syntax highlighting, code completion, and basic code formatting. Some popular code editors are Visual Studio Code and Sublime Text.

    An IDE is a comprehensive software suite that combines a code editor with additional tools and features specifically designed for software development. In addition to code editing capabilities, IDEs typically provide features like debugging, code refactoring, project management, and version control integration. Examples of popular IDEs include PyCharm, IDLE and

    Enjoying the preview?
    Page 1 of 1