O'Reilly logo

Python Recipes Handbook: A Problem-Solution Approach by Joey Bernard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Joey Bernard 2016

Joey Bernard, Python Recipes Handbook, 10.1007/978-1-4842-0241-8_2

2. Numbers, Dates, and Times

Joey Bernard

(1)Fredericton, New Brunswick, Canada

The initial purpose of electronic computers was to calculate the answers to physical problems. This depended on the efficient use of numbers, and handling them correctly. This still consumed most of the CPU cycles spent in the average computer program. Along with dealing with numbers, there are many cases where you need to be able to handle dates and times. This gets a bit messy when you need to make comparisons between different time zones or across years with leap days.

2-1. Creating Integers

Problem

You need to create integers.

Solution

There are several ways to create integers . The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required