Skip to main content

Introduction to Programming

  • Chapter
  • First Online:
The Python Workbook

Part of the book series: Texts in Computer Science ((TCS))

  • 13k Accesses

Abstract

Programming is a skill that is best learned through hands-on experience. This chapter concisely introduces the concepts that a new programmer will need to create their first programs in Python and includes 34 exercises that will let them put those concepts into practice. The particular concepts that this chapter introduces include:

  • Generating output with print statements,

  • Reading input values from the user,

  • Storing and manipulating integer, floating-point and string values,

  • Converting values from one data type to another,

  • Calling functions to perform a task, and

  • Formatting output.

Learning about these concepts and writing programs that use them effectively is an important step toward the creation of larger programs that solve more interesting problems.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 49.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 54.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Variable names are case sensitive. As a result, count, Count and COUNT are distinct variable names, despite their similarity.

  2. 2.

    Python provides several different mechanisms for formatting strings including the formatting operator, the format function and format method, template strings and, most recently, f-strings. We will use the formatting operator for all of the examples and exercises in this book but the other techniques can also be used to achieve the same results.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ben Stephenson .

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Stephenson, B. (2019). Introduction to Programming. In: The Python Workbook. Texts in Computer Science. Springer, Cham. https://doi.org/10.1007/978-3-030-18873-3_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-18873-3_1

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-18872-6

  • Online ISBN: 978-3-030-18873-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics