CHAPTER 4

Mathematical Functions, Strings, and Objects

 

Objectives

  • To solve mathematics problems by using the functions in the math module (§4.2).
  • To represent and process strings and characters (§4.3).
  • To encode characters using ASCII and Unicode (§4.3.1).
  • To use the ord function to obtain a numerical code for a character and the chr function to convert a numerical code to a character (§4.3.2).
  • To represent special characters using the escape sequence (§4.3.3).
  • To invoke the print function with the end argument (§4.3.4).
  • To convert numbers to a string using the str function (§4.3.5).
  • To use the + operator to concatenate strings (§4.3.6).
  • To read strings from the keyboard (§4.3.7).
  • To test substrings using the in and not in operators (§4.3.8). ...

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.