1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
finlep [7]
3 years ago
9

Description

Computers and Technology
1 answer:
lapo4ka [179]3 years ago
5 0

Answer:

from datetime import time, datetime, timedelta, date

for _ in iter(list, 0):

   t1 = input("Please enter time one: ")

   t2 = input("Please enter time two: ")

   if t1.isdigit() == True and (int(t1[:2])<=23 and int(t1[2:]) <= 59)\

       and t2.isdigit() == True and (int(t2[:2])<= 23 and int(t2[2:])<=59):

       time_1 = time(hour=int(t1[:2]), minute=int(t1[2:]))

       time_2 = time(hour= int(t2[:2]), minute=int(t2[2:]))

       if time_1 > time_2:

           diff = datetime. combine (date. today( ), time_1) - datetime. combine(date. today ( ), time_2)

       else:

           diff = datetime. combine (date. today( ), time_2) -datetime. combine(date. today ( ), time_1)

       diff_list = str(diff).split(":")

       del diff_list[2]

       diff_t = "". join (diff_list)

       print(diff_t)

       break        

   if t1.isdigit() == False or t2.isdigit() == False:

       print("Military Time Forest Required: Bad input, try again.")

       continue

   elif int(t1[:2])> 23 or int(t2[:2])> 23:

       print("Military Tine Format Required: Hours must be between 00 and 23, try again")

       continue

   elif int(t1[2:])> 59 or int(t2[2:])> 59:

       print("Military Tine Format Required: Minutes must be between me and 59, try again")

       continue

Explanation:

The python Datetime package is used to manipulate date and time, creating immutable Datetime objects from the various python data types like integer and string. The block of code above is a conditional for-loop statement that gets two user time value inputs and prints out the difference as a string in Military forest time format.

You might be interested in
What type of malware actually evolves, changing its size and other external file characteristics to elude detection by antivirus
Free_Kalibri [48]

Answer:

This type of malware are called Polymorphic Malware.

6 0
3 years ago
And there you go <br> sorry its saying my thing is tooo small
zaharov [31]

Answer:

Global knowledge is the answer

6 0
4 years ago
Read 2 more answers
CS124 PRATCTICE
Levart [38]

Answer:

b

Explanation:

6 0
3 years ago
1. How does the computer take data and information ?​
aniked [119]

Answer:

Data processing, Manipulation of data by a computer. It includes the conversion of raw data to machine-readable form, flow of data through the CPU and memory to output devices, and formatting or transformation of output. Any use of computers to perform defined operations on data can be included under data processing.  Input devices accept data in a form that the computer can use; they then send the data to the processing unit. The processor, more formally known as the central processing unit (CPU), has the electronic circuitry that manipulates input data into the information people want.

Explanation:

6 0
3 years ago
Suggest three ways in which celebrating an occasion influences food choices?
Basile [38]

Celebrating influences food in more than 1 way
6 0
3 years ago
Read 2 more answers
Other questions:
  • Suppose you have a 12-hour clock on a very fancy chair (noon is 12 PM and midnight is 12 AM). Write a C++ program that reads in
    7·1 answer
  • What is c also write it's features
    15·2 answers
  • How would you display all your photographic work in your résumé, if you have a large volume of work?
    10·1 answer
  • The _____ handles the instructions for your computer to start up before the operating system is loaded.
    11·1 answer
  • Can u tell me the answers to this table ​
    12·1 answer
  • 1) If a robot has a 3 bit instruction set and needs 20 instructions to reach its destination, how many bits of memory are requir
    5·1 answer
  • a term to describe article that can be displayed in their entirety as opposed to abstract and reference only?​
    10·1 answer
  • HELP PLEASE!!!! If you are continually building, reviewing, correcting a model of your system, and incrementally adding to the s
    9·1 answer
  • What woman ran for president on the National Equal Rights Party, receiving 4,149 votes in 6 states in 1884?
    5·1 answer
  • Kelly is evaluating the following image. Which of the statements that she makes about the photograph is true?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!