mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-20 05:29:48 +00:00
added a docstring
This commit is contained in:
parent
cfae621f46
commit
0494d48f84
@ -2,6 +2,19 @@ from __future__ import print_function
|
|||||||
import math
|
import math
|
||||||
|
|
||||||
def rearrange(bitString32):
|
def rearrange(bitString32):
|
||||||
|
"""[summary]
|
||||||
|
Regroups the given binary string.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
bitString32 {[string]} -- [32 bit binary]
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
ValueError -- [if the given string not are 32 bit binary string]
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
[string] -- [32 bit binary string]
|
||||||
|
"""
|
||||||
|
|
||||||
if len(bitString32) != 32:
|
if len(bitString32) != 32:
|
||||||
raise ValueError("Need length 32")
|
raise ValueError("Need length 32")
|
||||||
newString = ""
|
newString = ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user