<prompt> Write a function to convert a given hexadecimal number to its decimal equivalent.  <response>: Here is one way to write a function in Python that converts a given hexadecimal number to its decimal equivalent:pythondef hex_to_decimalhex_num: decimal_num inthex_num, 16 return decimal_numThis function takes in a hexadecimal number as its argument and uses the built-in int function with a base of 16 to perform the conversion. The resulting decimal number is returned.For example, if you call hex_to_decimalA, the function will return 10, because the hexadecimal number A is equivalent to the decimal number 10. Similarly, if you call hex_to_decimal1F, the function will return 31.Note that this function expects the hexadecimal number to be passed in as a string, with each digit represented using the characters 0-9 and A-F or a-f. 