course content

Course Content

Numeral Systems 101

One More Ciphering ChallengeOne More Ciphering Challenge

I appreciate your efforts a lot! Here you are going to dive deeper into ciphering and the last issue for you is converting a number from a decimal numeral system to a hexadecimal one. Try to do it using strings😉.

  1. You need to divide the number by 16, and take down the remainder of the division.
  2. If the number is greater than 9, you need to find a match in letters.
  3. Then you should calculate the received number and implement the first step to it.
  4. You can stop if division results in 0.
  5. Rewrite remainders in the reversed order.

Task

Time to hone your skills! Follow the algorithm and fill the gaps to receive a number in hex representation:

  1. Print the decimal_number variable.
  2. Create an empty list for storing hexadecimal_number.
  3. Define the loop which executes till the decimal_number is 0.
  4. Count the remainder of division decimal_number by 16.
  5. Make the string hexadecimal_number reversed.
  6. Join all elements of the string hexadecimal_number.

Everything was clear?

Section 3. Chapter 2
toggle bottom row