CHAPTER 2

Elementary Programming

 

Objectives

  • To write programs that perform simple computations (§2.2).
  • To obtain input from a program’s user by using the input function and to convert strings to numbers using the int and float functions (§2.3).
  • To use identifiers to name elements such as variables and functions (§2.4).
  • To assign data to variables (§2.5).
  • To perform simultaneous assignment (§2.6).
  • To define named constants (§2.7).
  • To use the operators +, , *, /, //, %, and ** (§2.8).
  • To program using division and remainder operators (§2.9).
  • To write and evaluate numeric expressions (§2.10).
  • To use augmented assignment operators to simplify coding (§2.11).
  • To perform numeric type conversion and rounding with the round function (§2.12). ...

Get Introduction to Python Programming and Data Structures, 3rd Edition by Pearson now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.