What's The Difference In Code Between Hh:mm:ss And H:m:s

Skip to ContentProfile image of johnparillaSubmitted by johnparillaabout 13 yearsWhat's the difference in code between hh:mm:ss and h:m:s

My code got a check mark for completion but only displayed the time as “h:m:s”

How do I make it display hh:mm:ss?

Here is what I have:

print str(current_hour) + “:” + str(current_minute) + “:” + str(current_second)

Answer 50b66cc855fe73a1ea000585

1 vote

Permalink

You will need to do more formatting work, perhaps with conditionals. Since the values extracted are integers, times before 10:00 AM will be single digits which convert like 5 into “5”. The same happens with any minute or second that evaluates to a single digit integer.

Profile image of algotrunemanSubmitted by algotrunemanabout 13 years

Popular free courses

  • Free course

    Learn SQL

    In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.
    • Checker DenseBeginner Friendly.4 Lessons
  • Free course

    Learn JavaScript

    Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.
    • Checker DenseBeginner Friendly.11 Lessons
  • Free course

    Learn HTML

    Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.
    • Checker DenseBeginner Friendly.6 Lessons
Explore full catalog

Từ khóa » Hh Vs Hh