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

 

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

Given a 5-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, [0,0,1,0,1] represents binary 00101 (or decimal 5).


fiveDigitBinaryToDecimal([1, 1, 1, 1, 1]) → 31
fiveDigitBinaryToDecimal([0, 0, 0, 0, 0]) → 0
fiveDigitBinaryToDecimal([0, 0, 1, 0, 1]) → 5

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

def fiveDigitBinaryToDecimal(fiveDigitBinary):

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