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

 

amgreyson@gmail.com > binaryToDecimal
prev  |  next  |  chance

Given a 5-digit binary number, convert the number to a decimal value. Each digit is passed as an individual input, from most significant (d4) to least significant (d0).


binaryToDecimal(1, 1, 1, 1, 1) → 31
binaryToDecimal(0, 0, 0, 0, 0) → 0
binaryToDecimal(0, 0, 1, 0, 1) → 5

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

def binaryToDecimal(d4, d3, d2, d1, d0):

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