Python includes a strong collection of data types and data structures. We’ll revisit this phrase and its variations throughout this chapter. Choosing the appropriate representation for our data may be vital. In the best case, an incorrectly chosen data type may cause significant performance degradation. In the worst case, it may cause logical errors and lead to incorrect results.

This chapter provides tips about both traditional and“obscure data structures and types, including standard containers, counters, and various numbers. We’ll explore how to:

  • Work with complex numbers, rational numbers, and infinities
  • Easily create modules
  • Transform lists
  • Count items
  • Recognize the immutability of tuples

The chapter also includes suggestions about advanced class design (class attributes and customized object print-outs).

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy