filmov
tv
How to convert integers to binary form and binary strings to base ten using Python

Показать описание
A very basic video looking at number bases #mathematics #python
Python code:
from cmath import *
2270 == 2*(10**3) + 2*(10**2) + 7*(10**1) +0*(10**0)
int('110101', 2)
int('1110101', 2)
def pwr(b):
for i in range(0,11):
print(b, "to the power", i, "=", b**i)
pwr(2)
Python code:
from cmath import *
2270 == 2*(10**3) + 2*(10**2) + 7*(10**1) +0*(10**0)
int('110101', 2)
int('1110101', 2)
def pwr(b):
for i in range(0,11):
print(b, "to the power", i, "=", b**i)
pwr(2)