DEV Community

Cover image for Python for Beginners - Part 3 - Number, Date and Error Handling
LUCIANO DE SOUSA PEREIRA
LUCIANO DE SOUSA PEREIRA

Posted on • Originally published at lucianopereira.netlify.com

4

Python for Beginners - Part 3 - Number, Date and Error Handling

python_titulo
Third part of articles about the Microsoft's Python for Beginners series.
All the examples from the playlist are available in this GitHub repository: Python Examples.

Objective

You will learn about the operations with numbers, dates and how to handle errors.
A Python file was created to demonstrate each example.

Topics

number.py

Ex: Testing math operations with numbers and numeric strings.

code07

Running the example:

python .\examples\numbers.py

The result:

code08

date.py

Ex: Testing datetime functions and formats.

code09

Running the example:

python .\examples\date.py

The result:

code10

error_handling.py

Ex: Handling runtime errors.

code11

Running the example:

python .\examples\error_handling.py

The result:

code12

Next

You will learn how to work with conditional logics, collections and loops.

Video References

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay