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
All of the following are characteristics of a 4 year college except
klasskru [66]
D they offer few programs
4 0
3 years ago
Read 2 more answers
How many frequencies does a full-duplex qam-64 modem use?
Vsevolod [243]

The answer is 2 frequencies.

A Full-Duplex QAM 64 K Modem uses two frequencies. One frequency is used for upstream and the other for downstream. A variety of common QAM forms are available and include, 16 QAM, 32 QAM, 64 QAM, and 256 QAM. For example, for domestic broadcast use, 64 and 256 QAM are used for cable modem and digital cable TV. The modulation scheme for this modem uses both amplitude and phase.

8 0
3 years ago
Read 2 more answers
Need help fast this is do a 4
Stells [14]

Answer:

I believe the answer is B.

8 0
3 years ago
What is a motherboard​
aleksandr82 [10.1K]

Answer:

A motherboard is the main printed circuit board in general-purpose computers and other expandable systems. It holds and allows communication between many of the crucial electronic components of a system

Explanation:

8 0
2 years ago
Which of these jobs would be most appropriate for someone who majors in information technology? managing a database for a large
Marrrta [24]

Answer:

A good job would be in the IT or getting a job at a network place maybe even a place like Best Buy

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • bj;ljfg'cfmb dfl kbslf jflk[gkdblkfd lbrkjlfbbfkjbdfjkbadbjbbkvbk'lbk'blbf;l;lkb lm;flklmkjlvkljvkljvbfbdsjsfbbjjlkbfjklbkfj'lgg
    9·2 answers
  • (fill in the blank) <br><br> ____ is when data is formatted, transmitted and received in a network.
    13·1 answer
  • Compound conditions require a computer to sense whether multiple conditions are true or false.
    9·1 answer
  • Which company was the first to develop personal computers?
    6·1 answer
  • JUST NEED TO KNOW WHO ALL DOSE EDGINUITY
    12·2 answers
  • Which is a concept of the CIA of Computer Security
    7·1 answer
  • Josh needs to write a research report for his Civics class. Which file type will allow him to save his file? (5 points)
    12·1 answer
  • How do i mark brainliest?
    6·2 answers
  • File names should be limited to 144 characters.<br><br> true or false
    12·1 answer
  • Plagiarism is considered
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!