Converting Hours to Seconds in Python

A Beginner’s Guide to Writing a Simple Function

Max N
2 min readJun 15, 2023

--

Photo by Elias Michel on Unsplash

Problem Statement

The problem we’re trying to solve is as follows:

Write a function that converts hours into seconds.

Here are some examples of how the function should work:

  • how_many_seconds(2) ➞ 7200

--

--

Max N

A writer that writes about JavaScript and Python to beginners. If you find my articles helpful, feel free to follow.