DSCI 559 – Spring 2021
Lab #2: Encode and decode with Python
数据管理作业代写 Use the bytearray function “fromhex” to encode the sequence “555343” from hex to a UTF-8 encoded array. (2 points)
The purpose of this lab is to help you play around with encoding and decoding in Python.
Task:
1.Encode the string of your 10-digit USC id using UTF-16 and show the result. (2 points)
2.Decode b’\xff\xfef\x00i\x00g\x00h\x00t\x00o\x00n\x00′ using UTF-16 and show the result. (2 points)
3.Decode b’\xe6\x96\xb0\xe5\xb9\xb4\xe5\xbf\xab\xe4\xb9\x90′ using UTF-8 and show the result. (2 points) 数据管理作业代写
4.Encode your result from Task3 using UTF-16 and show the result in hexadecimal. (2 points)
5.Use the bytearray function “fromhex” to encode the sequence “555343” from hex to a UTF-8 encoded array. (2 points)
Submission: 数据管理作业代写
Submit a single notebook file on Blackboard FirstName_LastName_lab2.ipynb.
Grading Criteria: 数据管理作业代写
Late submissions (up to 24 hours) will be penalized by 20%. No credit will be given after 24 hours of the submission deadline.
1 Hint: Google bytearray.from hex