Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how do i put this python code into tabular format? # Input partial hex string hexstring = ( input ( Enter the hex string:

how do i put this python code into tabular format? # Input partial hex string
hexstring =(input("Enter the hex string: ")) # this is the input statement that you should have.
partition_1= hexstring[0:32] #Slices out partition 1
starting_lba_address = partition_1[16:24] #Slices out the starting LBA Address
size_in_sectors = partition_1[24:32] #Slices out the size in sectors
starting_chs_address ='020300'
partition_type ='06'
ending_chs_address ='0333C7'
#starting_lba_address ='80000000'
#Input sectors
#size_in_sectors ='00100300'
le_starting_lba_address = starting_lba_address[6:8]+ starting_lba_address[4:6]+ starting_lba_address[2:4]+ starting_lba_address[0:2]
le_size_in_sectors = size_in_sectors[6:8]+ size_in_sectors[4:6]+ size_in_sectors[2:4]+ size_in_sectors[0:2]
# change hex string to bytes
decimal_for_le_starting_lba_address = int(le_starting_lba_address, 16)
decimal_for_le_size_in_sectors = int(le_size_in_sectors,16)
capacity = decimal_for_le_size_in_sectors*512/1048576
#print for results
print('Partition 1:')
#print('Starting CHS Address:', starting_chs_address)
#print('Partition Type:', partition_type)
#print('Ending CHS Address:', ending_chs_address)
#print('Starting LBA Address:', starting_lba_address)
#print('Size in sectors:', size_in_sectors)
#print('LE Starting LBA Address:', le_starting_lba_address)
#print('LE Size in sectors:', le_size_in_sectors)
print('The decimal for the LE Starting LBA Address:', decimal_for_le_starting_lba_address)
print('The decimal for the LE Size in sectors:', decimal_for_le_size_in_sectors)
print ('Capacity', capacity)
# Input partial hex string
hexstring =(input("Enter the hex string: "))
partition_2= hexstring[0:32] #Slices out partition 2
starting_lba_address = partition_2[16:24] #Slices out the starting LBA Address
size_in_sectors = partition_2[24:32] #Slices out the size in sectors
starting_chs_address ='0334C7'
partition_type ='06'
ending_chs_address ='0A4A20'
#starting_lba_address ='80100300'
#Input sectors
#size_in_sectors ='00600100'
le_starting_lba_address = starting_lba_address[6:8]+ starting_lba_address[4:6]+ starting_lba_address[2:4]+ starting_lba_address[0:2]
le_size_in_sectors = size_in_sectors[6:8]+ size_in_sectors[4:6]+ size_in_sectors[2:4]+ size_in_sectors[0:2]
# change hex string to bytes
decimal_for_le_starting_lba_address = int(le_starting_lba_address, 16)
decimal_for_le_size_in_sectors = int(le_size_in_sectors,16)
capacity = decimal_for_le_size_in_sectors*512/1048576
#print for results
print('Partition 2:')
#print('Starting CHS Address:', starting_chs_address)
#print('Partition Type:', partition_type)
#print('Ending CHS Address:', ending_chs_address)
#print('Starting LBA Address:', starting_lba_address)
#print('Size in sectors:', size_in_sectors)
#print('LE Starting LBA Address:', le_starting_lba_address)
#print('LE Size in sectors:', le_size_in_sectors)
print('The decimal for the LE Starting LBA Address:', decimal_for_le_starting_lba_address)
print('The decimal for the LE Size in sectors:', decimal_for_le_size_in_sectors)
print ('Capacity', capacity)
# Input partial hex string
hexstring =(input("Enter the hex string: "))
partition_3= hexstring[0:32] #Slices out partition 3
starting_lba_address = partition_3[16:24] #Slices out the starting LBA Address
size_in_sectors = partition_3[24:32] #Slices out the size in sectors
starting_chs_address ='0A6B22'
partition_type ='06'
ending_chs_address ='02A202'
#starting_lba_address ='80780400'
#Input sectors
#size_in_sectors ='00700300'
le_starting_lba_address = starting_lba_address[6:8]+ starting_lba_address[4:6]+ starting_lba_address[2:4]+ starting_lba_address[0:2]
le_size_in_sectors = size_in_sectors[6:8]+ size_in_sectors[4:6]+ size_in_sectors[2:4]+ size_in_sectors[0:2]
# change hex string to bytes
decimal_for_le_starting_lba_address = int(le_starting_lba_address, 16)
decimal_for_le_size_in_sectors = int(le_size_in_sectors,16)
capacity = decimal_for_le_size_in_sectors*512/1048576
#print for results
print('Partition 3:')
#print('Starting CHS Address:', starting_chs_address)
#print('Partition Type:', partition_type)
#print('Ending CHS Address:', ending_chs_address)
#print('Starting LBA Address:', starting_lba_address)
#print('Size in sectors:', size_in_sectors)
#print('LE Starting LBA Address:', le_starting_lba_address)
#print('LE Size in sectors:', le_size_in_sectors)
print('The decimal for the LE Starting LBA Address:', decimal_for_le_starting_lba_address)
print('The decimal for the LE Size in sectors:', decimal_for_le_size_in_sectors)
print ('Capacity', capacity)
# Input partial hex string
hexstring =(input("Enter the hex string: "))
partition_4= hexstring[0:32] #Slices out partition 4
starting_lba_address = partition_4[16:24] #Slices out the starting LBA Address
size_in_sectors = partition_4[24:32] #Slices out the size in sectors

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

Students also viewed these Databases questions

Question

How did the plague contribute to the Renaissance?

Answered: 1 week ago

Question

Contrast intelligence and emotional intelligence.

Answered: 1 week ago

Question

Briefly describe four guides to ethical decision-making

Answered: 1 week ago