subject

Write a python program to do the following. ask user to enter time in the format of hh: mm: ss. for example, 11: 07: 28. hour must be a two-digit number between 0 and 23, inclusive. minute and second must be two-digit numbers between 0 and 59, inclusive. the program needs to check whether the time entered is valid.
check whether there are exactly two colons. display an error message and stop if the input is invalid.
check whether hour is a two-digit number. display an error message and stop if the input is invalid.
check whether minute is a two-digit number. display an error message and stop if the input is invalid.
check whether second is a two-digit number. display an error message and stop if the input is invalid.
check whether hour is between 0 and 23, inclusive. display an error message and stop if the input is invalid.
check whether minute is between 0 and 59, inclusive. display an error message and stop if the input is invalid.
check whether second is between 0 and 59, inclusive. display an error message and stop if the input is invalid.
if the time entered is valid, remove the colons and display the time. for example, if the input time is 11: 07: 28, the program should display 110728.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Signal sets company contracts to deliver one hundred 52-inch plasma high-definition television sets to a new retail customer, tuner tv store, on may 1, with payment to be made on delivery. signal tenders delivery in its own truck. tuner's manager notices that some of the cartons have scrape marks. tuner's owner phones signal's office and asks whether the sets might have been damaged as they were being loaded. signal assures tuner that the sets are in perfect condition. tuner tenders signal a check, which signal refuses, claiming that the first delivery to new customers is always for cash. tuner promises to pay the cash within two days. signal leaves the sets with tuner, which stores them in its warehouse pending its "grand opening sale" on may 15. two days later, tuner's stocker opens some of the cartons and discovers that a number of the sets are damaged beyond ordinary repair. signal claims tuner has accepted the sets and is in breach by not paying on delivery. will signal succeed on these claims? explain.
Answers: 1
question
Computers and Technology, 22.06.2019 15:20
The north and south regions had very diferent economies in the 1800s.
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
Avariable definition defines the name of a variable that will be used in a program, as well as
Answers: 3
question
Computers and Technology, 22.06.2019 21:00
Which of these is most responsible for differences between the twentieth century to the twenty-first century?
Answers: 2
You know the right answer?
Write a python program to do the following. ask user to enter time in the format of hh: mm: ss. for...
Questions
question
Chemistry, 20.02.2021 01:00
question
Mathematics, 20.02.2021 01:00
question
History, 20.02.2021 01:00
question
Mathematics, 20.02.2021 01:00
question
Mathematics, 20.02.2021 01:00
Questions on the website: 13722367