diff options
Diffstat (limited to 'challenge-185/eric-cheung/python/ch-1.py')
| -rwxr-xr-x | challenge-185/eric-cheung/python/ch-1.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-185/eric-cheung/python/ch-1.py b/challenge-185/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..bd155daa2e --- /dev/null +++ b/challenge-185/eric-cheung/python/ch-1.py @@ -0,0 +1,14 @@ +
+## Task 1: MAC Address
+## Input Format: hhhh.hhhh.hhhh
+## Output Format: hh:hh:hh:hh:hh:hh
+
+## strInputMACAddr = "1ac2.34f0.b1c2" ## Example 1
+strInputMACAddr = "abc1.20f1.345a" ## Example 2
+
+strNoSplit = strInputMACAddr.replace(".", "")
+arrPartSplit = [strNoSplit[nIndx] + strNoSplit[nIndx + 1] for nIndx in range(0, len(strNoSplit), 2)]
+
+strOutputMACAddr = ":".join(arrPartSplit)
+
+print (strOutputMACAddr)
|
