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

 

gaurav1780@gmail.com 08_bitwise > ipv4
prev  |  next  |  chance

An IPv4 address is a 32-bit address of the form aaa.bbb.ccc.ddd where aaa, bbb, ccc, and ddd are all in the range 0 to 255. Given an integer that stores an IPv4 address with the most-significant bits representing aaa, second most-significant bits representing bbb, and so on, returns the IPv4 address in the canonical form of "aaa.bbb.ccc.ddd"


ipv4(-1) → '255.255.255.255'
ipv4(-1062731519) → '192.168.1.1'
ipv4(-1062731266) → '192.168.1.254'

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

def ipv4 (n):

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: 5 Post-solution available

Copyright Nick Parlante 2017 - privacy