id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

amgreyson@gmail.com algebra-1 > threeDigitBinaryToDecimal
prev  |  next  |  chance

Given a 3-digit binary number, return the number converted to its decimal equivalent. The binary number is passed as a list of 0's and 1's, beginning with the most significant digit. For example, [1,0,1] represents binary 101 (or decimal 5).


threeDigitBinaryToDecimal([1, 1, 1]) → 7
threeDigitBinaryToDecimal([0, 0, 0]) → 0
threeDigitBinaryToDecimal([1, 0, 1]) → 5

...Save, Compile, Run (ctrl-enter)

def threeDigitBinaryToDecimal(threeDigitBinary):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 125

Copyright Nick Parlante 2017 - privacy