Answer:
- def processTime(timeStr):
- timeData = timeStr.split(" ")
- timeComp = timeData[0].split(":")
- h = int(timeComp[0])
- m = int(timeComp[1])
-
- output = ""
-
- if(timeData[1] == "AM"):
- if(h < 10):
- output += "0" + str(h) + str(m) + " hours"
- elif(h == 12):
- output += "00" + str(m) + " hours"
- else:
- output += str(h) + str(m) + " hours"
- else:
- h = h + 12
- output += str(h) + str(m) + " hours"
-
- return output
-
- print(processTime("11:30 PM"))
Explanation:
The solution code is written in Python 3.
Firstly, create a function processTime that takes one input timeStr with format "HH:MM AM" or "HH:MM PM".
In the function, use split method and single space " " as separator to divide the input time string into "HH:MM" and "AM" list items (Line 2)
Use split again to divide first list item ("HH:MM") using the ":" as separator into two list items, "HH" and "MM" (Line 3). Set the HH and MM to variable h and m, respectively (Line 4-5)
Next create a output string variable (Line 7)
Create an if condition to check if the second item of timeData list is "AM". If so, check again if the h is smaller than 10, if so, produce the output string by preceding it with a zero and followed with h, m and " hours" (Line 9 - 11). If the h is 12, precede the output string with "00" and followed with h, m and " hours" (Line 12 - 13). Otherwise generate the output string by concatenating the h, m and string " hours" (Line 14 -15)
If the second item of timeData is "PM", add 12 to h and then generate the output string by concatenating the h, m and string " hours" (Line 17 -18)
Test the function (Line 22) and we shall get the sample output like 2330 hours
value = float(input("Enter a number: "))
if value > 45.6:
print("Greater than 45.6")
I hope this helps!
Answer:
i play rblx
Explanation:
queenloveadriana (main acc)
AdiosLoca (alt)
Azazel_Iblis (the acc I'll use for my YT channel)
I also play Fn, CofD, Destiny, 2k, Mortal Combat, but my PS4 broke and I'm waiting to get my PS5 that I ordered
A cable inside the computer transferring data between the mother board and storage devices is referred to as a storage device cable.
<h3>What is a hard drive?</h3>
A hard drive can be defined as an electro-mechanical, non-volatile data storage device that is made up of magnetic disks (platters) that rotates at high speed.
In Computer technology, all hard drives are commonly installed on computers and other digital service for the storage of digital files and to enable the booting of a computer through its operating system (OS).
In conclusion, a cable inside the computer that is designed and developed to facilitate the transfer of data between the mother board and storage devices is referred to as a storage device cable such as Serial Advanced Technology Attachment (SATA).
Read more on hard drive here: brainly.com/question/26382243
#SPJ1