CHAPTER 7
TASKS WITH NUMBERS
This chapter shows you how to perform various tasks involving numbers and lists of numbers in Python.
The first part of this chapter contains a short introduction to time and complexity of algorithms, which involves concepts such as “big O” and “small O.”
The second part of this chapter shows you how to calculate the sum of the even numbers and the sum of odd numbers in a list. You will also see how to calculate the number of digits in a positive integer.
The third part of this chapter shows you how to find the prime factorization of a positive integer. You will also learn how to verify Goldbach’s conjecture for some small integers, which states that every even number greater than 2 is the sum of two prime numbers. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access