Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Untitled
Galebickosikasa
Oct 21st, 2019
213
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
text
0.20 KB
| None
|
0
0
raw
download
clone
embed
print
report
def to_ten(x, p):
x = str(x)
ans = 0
ns = 1
for i in range(len(x) - 1, -1, -1):
ans += int(x[i]) * ns
ns *= p
return ans
t = 1001100110
print(to_ten(t, 2))
Advertisement
Add Comment
Please,
Sign In
to add comment
Public Pastes
Untitled
15 hours ago | 2.28 KB
GSA NS
19 hours ago | 1.37 KB
WaterFul.m
MatLab | 21 hours ago | 0.42 KB
WaterEmpty.m
MatLab | 21 hours ago | 0.54 KB
Spinning.m
MatLab | 21 hours ago | 0.53 KB
Drying.m
MatLab | 21 hours ago | 0.48 KB
DoorCls.m
MatLab | 21 hours ago | 0.55 KB
Washing.m
MatLab | 21 hours ago | 0.45 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!