0
how can i mutiple two binary numbers?is there any functions for that in py?
6 Respostas
+ 2
The meaning of base is the weight you have to assign to your digits.
For example:
print(int('1101',2)) gives you 13, because 1*2**0 + 0*2**1 + 1*2**2 + 1*2**3 is 13
but print(int('1101',8)) gives 577, because 1*8**0 + 0*8**1 + 1*8**2 + 1*8**3 is 577
+ 1
mahsa
plz visit it
https://stackoverflow.com/questions/36433448/JUMP_LINK__&&__python__&&__JUMP_LINK-binary-multiplication-algorithm
You can do 1 thing in my opinion
convert both Binary Numbers in decimal Numbers & multiply them
& again convert the product in binary form
+ 1
If your input are two strings, for example a='1101' and b='10'
just print(int(a,2) * int(b,2))
+ 1
mahsa
It's the base of the binary number
0
Bilbo Baggins
thanks a lot...but why i must use 2??what does it work?
0
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥
thanks 🌹