Assign to variable date the splice of string log


Translate each part into a Python statement:

(a) Assign to variable log the next string, which happens to be a fragment of a log of a request for a text file from a web server: 128.0.0.1 - - [12/Feb/2011:10:31:08 -0600] "GET /docs/test.txt HTTP/1.0"

(b) Assign to variable address the substring of log that ends before the first blankspace in log, using the string method split() and the indexing operator.

(c) Assign to variable date the splice of string log containing the date (12/Feb ... -6000), using the indexing operator on string log.

For each of the below string values of s, write the expression involving s and the string methods split() that evaluates to list: ['10', '20', '30', '40', '50', '60']

(a) s = '10 20 30 40 50 60'

(b) s = '10,20,30,40,50,60'

(c) s = '10&20&30&40&50&60'

(d) s = '10 - 20 - 30 - 40 - 50 - 60'

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Assign to variable date the splice of string log
Reference No:- TGS01541576

Now Priced at $15 (50% Discount)

Recommended (94%)

Rated (4.6/5)