8 Programming
8 Programming
substring = user_string[start_index:end_index]
result = x + y
return result
3. A logical shift instruction moves each bit in the binary value left or right. What is the
new value of 00101100 when a logic shift right by two is performed? What is the new
value of 00011100 when a logic shift left by three is performed?
4. If 84 is represented as a denary, calculate its hexadecimal value.
5. Convert the following binary values into hexadecimal representation. 00111100 ,
10100101 , 11101111