Published in 2022 by The Rosen Publishing Group, Inc.
29 East 21st Street, New York, NY 10010
Copyright 2022 by The Rosen Publishing Group, Inc.
First Edition
All rights reserved. No part of this book may be reproduced in any form without permission in writing from the publisher, except by a reviewer.
Library of Congress Cataloging-in-Publication Data
Names: Small, Cathleen, author.
Title: Coding activities for building apps with Python / Cathleen Small.
Description: First edition. | New York: Rosen Publishing, 2022. | Series: Code creator | Audience: Grades 712. |
Includes bibliographical references and index.
Identifiers: LCCN 2019005868| ISBN 9781725340961 (library bound) | ISBN 9781725340954 (paperback)
Subjects: LCSH: Computer programmingJuvenile literature. | Application softwareDevelopmentJuvenile literature. | Python (Computer program languageJuvenile literature.
Classification: LCC QA76.6115 .S628 2022 | DDC 005.1dc23
LC record available at https://lccn.loc.gov/2019005868
Manufactured in the United States of America
Some of the images in this book illustrate individuals who are models. The depictions do not imply actual situations or events.
CPSIA Compliance Information: Batch #CSRYA22. For further information contact Rosen Publishing, New York, New York at 1-800-237-9932.
Contents
Introduction
Who is behind the medical billing systems that hospitals, doctors, and insurance companies use? Coders. What about behind the software used by animators and effects specialists in the film industry? Coders. Who develops Fortnite, Call of Duty, and other exciting video games? Yes, more coders.
Coding is an exciting and lucrative profession for anyone with an interest in technology or computers. The tech world is constantly changing and expanding, and coding careers are available in nearly every other field, as well. Every industry now uses computer software and applications in one way or another, and it is coders who create that software and those applications.
In the early days of computing, software was king. Anything that was not hardware (the physical pieces of the computer system and its peripherals, such as a keyboard) was software. In a sense, that is still the case: there is hardware (computers, laptops, tablets, smartphones, printers, and so on), and then there are the software programs that run on them. However, recent years of computing have seen the rise of one specific type of software: the application, better known as an app.
Applications are pieces of software that are executable. That is, they run and perform an activity or set of tasks on their own. All applications are executable, and all applications are software but not every piece of software is an application; software that is not executable is not generally considered an app.
Most of the software people use is for the purpose of doing something (a task or set of tasks), so much of what people use today is applications. Accordingly, coding for apps is an in-demand field with many opportunities.
The opportunities are limitless when it comes to coding, with new apps being developed every day by both experienced professionals and enthusiastic amateurs.
Apps can be written in many different programming languages, and everyone has their favorites. Some frequently used programming languages for building apps include: Java, JavaScript, PHP, C++, Objective-C, C#, Perl, and HTML. The platform the app is intended for (i.e., MacOS, iOS, Windows, or Android) sometimes determines the best programming language to use, but some languages can be used to develop apps for multiple platforms. For example, Swift was created by Apple and is used for creating apps for MacOS and iOS, while Perl is generally used for developing Android apps.
Android, MacOS, and iOS are three very common platforms for which apps are created.
One of the most commonly used programming languages for multiplatform development is Python. It is relatively simple and very versatile, making it a good first language for aspiring coders. It is also considered a strong general-purpose programming language, meaning it can be used for nearly any type of programming. It can run on multiple platforms, including Windows, MacOS, Linux, and Unix. To give an idea of just how widely used Python is: it is the language behind Googles search engine, YouTube, and the New York Stock Exchanges web transaction system.
Python is a solid choice as a first programming language for new coders. It is simple and incredibly versatile.
Because Python is so versatile and very readable, all of the code blocks in this book will use Python. You will learn to use Python to do simple math, work with strings, compare and convert data, store variables, send email, and even create a few simple games.
Though it may seem scary, do not be daunted by learning a new language. By starting to code in small snippets, you will build a strong foundation for future learning. After you have learned to create these pieces of applications, you will be well equipped to explore application programming on a larger scaleusing Python or branching out to another language.
Ready to jump in and start learning Python to build apps? There are a few ways to get started. You can download the latest version of Python from https://python.org and open the command line on your computer. How you access the command line depends on your operating system, but a quick internet search should tell you how to do it on your machine. Alternatively, you can use text-editing software, such as Text Editor for Windows or TextEdit for Mac. Finally, you can use an integrated development environment (IDE) to write your code.
There are a number of free IDEs you can download and use to practice your coding. For Python, PyCharm is particularly user-friendly.
All of the code for this book was developed and tested in PyCharm. It would be impossible to give instructions for how to use every IDE out there, but if you choose to download PyCharm, here are some general instructions for downloading, launching, and using it:
Run a search for PyCharm on the website to access the latest version for your operating system.
Download it and install PyCharm in the desired location on your computer.
When you first launch the app, you will see a welcome window with a few options; creating a new project will allow you to name a new project (whatever you like) and launch it in the PyCharm virtual environment.
PyCharm is a robust IDE that allows you to do many things, but when you are just playing with code and testing it, scratch files are an easy way to go. In the file menu, right-click and follow New>New Scratch File. A submenu will show up in the middle of the IDE, from which you can select Python. A blank scratch file will open.
You can play in this scratch file to your hearts content. When you are ready to try running a script, either right-click again and select run, or press the green play arrow at the top of the window. Doing either will open a pane at the bottom of the screen, where you will see the output of your program.
Next page