Зміст курсу
Numeral Systems 101
Numeral Systems 101
Decipher Binary Number
Завдання
So far, so good 😃 Convert binary code to the decimal one. Fill the gaps and follow the algorithm. The result of your manipulations is a specific number in math .
- Create variable
decimal_number
for storing converted decimal number and assign0
to it. - Print the binary number.
- Define the variable
power
and assign0
to it. - Define the loop that executes till the
binary number
is0
. - Count the remainder of division
binary_number
by10
and assign it to the variablelast_digit
. - Multiply
last_digit
by the2
raised to the relevant power. - Add the
result
to thedecimal_number
. - Decrease
binary_number
using integer division by10
. - Increase
power
by1
. - Print the
decimal number
.
Note
You received one of the Armstrong number: the sum of the cubes of its own digits, let me explain this: 370 = 3^3 + 7^3 + 0^3 = 27 + 343 + 0 = 370
Дякуємо за ваш відгук!
Decipher Binary Number
Завдання
So far, so good 😃 Convert binary code to the decimal one. Fill the gaps and follow the algorithm. The result of your manipulations is a specific number in math .
- Create variable
decimal_number
for storing converted decimal number and assign0
to it. - Print the binary number.
- Define the variable
power
and assign0
to it. - Define the loop that executes till the
binary number
is0
. - Count the remainder of division
binary_number
by10
and assign it to the variablelast_digit
. - Multiply
last_digit
by the2
raised to the relevant power. - Add the
result
to thedecimal_number
. - Decrease
binary_number
using integer division by10
. - Increase
power
by1
. - Print the
decimal number
.
Note
You received one of the Armstrong number: the sum of the cubes of its own digits, let me explain this: 370 = 3^3 + 7^3 + 0^3 = 27 + 343 + 0 = 370
Дякуємо за ваш відгук!
Decipher Binary Number
Завдання
So far, so good 😃 Convert binary code to the decimal one. Fill the gaps and follow the algorithm. The result of your manipulations is a specific number in math .
- Create variable
decimal_number
for storing converted decimal number and assign0
to it. - Print the binary number.
- Define the variable
power
and assign0
to it. - Define the loop that executes till the
binary number
is0
. - Count the remainder of division
binary_number
by10
and assign it to the variablelast_digit
. - Multiply
last_digit
by the2
raised to the relevant power. - Add the
result
to thedecimal_number
. - Decrease
binary_number
using integer division by10
. - Increase
power
by1
. - Print the
decimal number
.
Note
You received one of the Armstrong number: the sum of the cubes of its own digits, let me explain this: 370 = 3^3 + 7^3 + 0^3 = 27 + 343 + 0 = 370
Дякуємо за ваш відгук!
Завдання
So far, so good 😃 Convert binary code to the decimal one. Fill the gaps and follow the algorithm. The result of your manipulations is a specific number in math .
- Create variable
decimal_number
for storing converted decimal number and assign0
to it. - Print the binary number.
- Define the variable
power
and assign0
to it. - Define the loop that executes till the
binary number
is0
. - Count the remainder of division
binary_number
by10
and assign it to the variablelast_digit
. - Multiply
last_digit
by the2
raised to the relevant power. - Add the
result
to thedecimal_number
. - Decrease
binary_number
using integer division by10
. - Increase
power
by1
. - Print the
decimal number
.
Note
You received one of the Armstrong number: the sum of the cubes of its own digits, let me explain this: 370 = 3^3 + 7^3 + 0^3 = 27 + 343 + 0 = 370