Python 3 Two Code Examples, can't understand behaviour of split and format
Hey sololearners, i got a question concerning two code examples. Explanation: I open the URL Apple.com and want to get the header. If I use format, ..., I get the charset. But if I leave "format," as in 2nd Code I get an array. I really don't understand why is the function "format" working in the combination of split. ### 1. Code ### from urllib.request import Request from urllib.request import urlopen myRequest = Request('http://www.apple.com') myResponse = urlopen(myRequest) format, params = myResponse.getheader('Content-Type').split ### End of 1. Code ### ###Output 1. Code### charset=UTF-8 ###End of Output 1. Code### ### 2. Code ### from urllib.request import Request from urllib.request import urlopen myRequest = Request('http://www.apple.com') myResponse = urlopen(myRequest) params = myResponse.getheader('Content-Type').split ### End of 2. Code ### ###Output 2. Code### ['text/html', ' charset=UTF-8'] ###End of Output 2. Code### Thanks for your help.