แปลงสมาชิกลิสต์เป็น Unicode แล้วรวมกัน
ตัวอย่าง
strings = ['Tutorialspoint', 'is a popular', 'site', 'for tech leranings']
def get_unicode(string):
return string.encode()
strings_unicode = map(get_unicode, strings)
result = ' '.join(unicode.decode() for unicode in strings_unicode)
print(result)
# Tutorialspoint is a popular site for tech leranings
ผลลัพธ์
Tutorialspoint is a popular site for tech leranings
สรุป
ใช้ encode() แปลงเป็น bytes แล้ว decode() กลับมารวม