Question: what is the out put of this python code?# Python Hexadecimal MBR Tool print ( Python Hexadecimal BMR Tool V 1 . 0

what is the out put of this python code?# Python Hexadecimal MBR Tool
print("Python Hexadecimal BMR Tool V1.0")
h = input("Please enter your MBR hexadecimal string below")
#check for valid string length
while(len(h)%32!=0):
h = input("Oops! The string is invalid, try again")
#check for partition count
partcount = len(h)/32
#Definitions
count =0
k =0
#Table for Master Boot Record
print("{:<10}{:<0}{:<10}{:<0}{:<10}{:<0}{:<10}".format('Partition Number', '|', 'Start Sector', '|', 'Size in Sectors', '|', 'Capacity(MB,GB,TB)'))
while(partcount !=0):
sect =""
sectsize =""
#convert start sector to little endian
for e in range(22,15,-2):
sect += str(h[k:k +32][e])
sect += str(h[k:k +32][e +1])
#convert sector size to little endian
for e in range(30,23,-2):
sectsize += str(h[k:k +32][e])
sectsize += str(h[k:k +32][e +1])
#output table while converting to base 16
print("{:<18}{:<14}{:<17}{:<15}".format(count +1, int(sect,16), int(sectsize,16),(int(sectsize,16)*512)/1048576))
partcount = partcount -1
k = k +32
count = count +1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!