You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Unit 2/data.html
+24-9Lines changed: 24 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -719,24 +719,39 @@ <h2>Data Project 1 - Data Communication and Compression:<a class="headerlink" hr
719
719
<hrclass="docutils" />
720
720
<p><strong>2. Binary to ASCII Decoder</strong></p>
721
721
<p><strong>Objective:</strong> Write a function that takes a string of binary numbers (representing ASCII values) and converts it back into readable text.</p>
722
-
<p><strong>1. Create a Function with One Parameter</strong></p>
722
+
<olclass="arabic simple">
723
+
<li><p>Create a Function with One Parameter</p>
723
724
<ulclass="simple">
724
725
<li><p>The parameter should accept a <strong>binary string</strong> with groups of 8 digits separated by spaces.</p></li>
725
-
<li><p>This will be the message you want to decode.
726
-
<strong>2. Split the Message into Parts</strong></p></li>
726
+
<li><p>This will be the message you want to decode.</p></li>
727
+
</ul>
728
+
</li>
729
+
<li><p>Split the Message into Parts</p>
730
+
<ulclass="simple">
727
731
<li><p>Use a method to <strong>split</strong> the long binary message into a <strong>list</strong> of smaller strings.</p></li>
728
-
<li><p>Each piece should be exactly <strong>8 digits long</strong> — representing one character.
729
-
<strong>3. Create an Empty String to Store the Result</strong></p></li>
730
-
<li><p>You’ll build your decoded message <strong>one letter at a time</strong>, so start with an empty string.
731
-
<strong>4. For Each Binary Group:</strong></p></li>
732
+
<li><p>Each piece should be exactly <strong>8 digits long</strong> — representing one character.</p></li>
733
+
</ul>
734
+
</li>
735
+
<li><p>Create an Empty String to Store the Result</p>
736
+
<ulclass="simple">
737
+
<li><p>You’ll build your decoded message <strong>one letter at a time</strong>, so start with an empty string.</p></li>
738
+
</ul>
739
+
</li>
740
+
<li><p>For Each Binary Group:</p>
741
+
<ulclass="simple">
732
742
<li><p>Convert it from <strong>binary to decimal</strong> (this gives you the ASCII number).</p></li>
733
743
<li><p>Convert that decimal number to a <strong>character</strong> (letter, number, or symbol).</p></li>
734
-
<li><p>Add the character to your decoded message string.
735
-
<strong>5. Return the Final Text</strong></p></li>
744
+
<li><p>Add the character to your decoded message string.</p></li>
745
+
</ul>
746
+
</li>
747
+
<li><p>Return the Final Text</p>
748
+
<ulclass="simple">
736
749
<li><p>Once every group has been processed, return the final sentence made from all the characters.</p></li>
737
750
<li><p>Call your function and pass the binary message:</p></li>
738
751
<li><p>Display the result on screen using a <strong>label</strong> or print statement. It should reveal a <strong>readable sentence</strong>!</p></li>
0 commit comments