Introduction To Python Programming [Openstax]

Figure 1.1 Credit: Larissa Chu, CC BY 4.0

Chapter Outline

  1. 1.1 Background
  2. 1.2 Input/output
  3. 1.3 Variables
  4. 1.4 String basics
  5. 1.5 Number basics
  6. 1.6 Error messages
  7. 1.7 Comments
  8. 1.8 Why Python?
  9. 1.9 Chapter summary

Introduction

Computers and programs are everywhere in today’s world. Programs affect many aspects of daily life and society as a whole. People depend on programs for communication, shopping, entertainment, health care, and countless other needs. Learning how to program computers opens the door to many careers and opportunities for building a better world.

Programs consist of statements to be run one after the other. A statement describes some action to be carried out.

The statement print("Good morning") instructs Python to output the message "Good morning" to the user. The statement count = 0 instructs Python to assign the integer 0 to the variable count.

This chapter introduces statements for input and output, assigning variables, and basic arithmetic. Making mistakes is a normal part of programming, and the chapter includes advice on understanding error messages. The chapter ends with a short history of Python and discusses why Python has become so popular today.

[This work is not the copyright of Projeda.com. It is offered by OpenStax under a CC BY-A-NC 4.0 licence. You can access for free at https://openstax.org/books/introduction-python-programming/pages/1-introduction.]

[Udayan Das, Aubrey Lawson, Chris Mayfield, Narges Norouzi. Introduction to Python Programming. OpenStax. Mar 13, 2024. Book URL: https://openstax.org/books/introduction-python-programming/pages/1-introduction. Section URL: https://openstax.org/books/introduction-python-programming/pages/1-introduction.]

Atlas Appendix