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
A _______ is used to present data in a simplified, graphical format that allows your audience to read less text while still bein
steposvetlana [31]
Your correct answer would be Legend.


answer choice is B.
3 0
3 years ago
Read 2 more answers
Application software solve application programs true or false​
asambeis [7]

Answer: False

Explanation: Application software, on the other hand, refers to software that is designed to perform a certain task. It's just a collection of programs that customers can use.

8 0
2 years ago
Web browsers communicate with web servers using the ____ communication protocol.
jolli1 [7]
It is the HTTP protocol.
7 0
3 years ago
Which of the following is NOT a valid method to increase a variable named score by 1?
Fofino [41]

Answer:

a.

++score = score + 1

Explanation:

First you have to understand the increment operator;

There are three possible ways to increment the value of variable by 1.

1.  <u>post increment</u>

syntax:

name++

it using in expression first then increase the value by 1.

2. <u>Pre increment</u><u> </u>

syntax:

++name

it increase the value by 1 before it using in expression.

3. simple method

name = name +1

In the question,

option 1: ++score = score + 1

it increase the value of score by 2 because their are two increment is used first for (score + 1) and second ++score.

Therefore, the correct option is a.

5 0
2 years ago
Your worksheet contains confidential information in column C; to prevent others who use your worksheet from seeing the data, you
emmainna [20.7K]
To prevent others who use your worksheet from seeing the data you can hide column C
5 0
2 years ago
Other questions:
  • Stefan is finalizing his presentation by adding media files and preparing it for distribution. Stefan knows that saving a presen
    13·1 answer
  • How would I view the ruler on my document if it was not visible
    9·1 answer
  • A network technician is setting up a wireless access point in the front office of a small company. The technician needs to disab
    14·1 answer
  • Which industry has the highest employment figure for both teen and young adults in July, 2014?
    6·1 answer
  • You created the following dictionary relationships = {'Jimmy':'brother', 'Carol':'sister'}. You then executed the following code
    5·1 answer
  • When an instrument in the dashboard of your car informs you the air pressure in the right rear tire is low, what type of compute
    14·1 answer
  • Which browser should you choose if you want all viewing information except thumbnail previews of websites?
    15·2 answers
  • Given the following snippet of code, answer the following two questions based on the code: typedef enum {Sun, Mon, Tue, Wed, Thu
    15·1 answer
  • Kim agrees. You get the equipment from the truck and begin working. Kim approaches you as you are installing the modem and is a
    9·1 answer
  • From which os did windows xp evolve?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!