nancieabreu6063 nancieabreu6063
  • 03-01-2020
  • Computers and Technology
contestada

When reading data across the network (i.e. from a URL) in Python 3, what string method must be used to convert it to the internal format used by strings?

Respuesta :

colocho08
colocho08 colocho08
  • 15-01-2020

Answer:

decode( )

Explanation:

We can use the method decode( ) to decode the string using the codec registered for encoding.

There are two parameters

encoding: We can encode with this parameter.

errors: If used to manage the errors.

For example:

String = "this is string example....wow!!!";

String = Str.encode('base64','strict');

If we print these variables we have:

String = b'dGhpcyBpcyBzdHJpbmcgZXhhbXBsZS4uLi53b3chISE='

String = this is string example....wow!!!

Answer Link

Otras preguntas

Romeo and Juliet essay
Please help and explain questions 20-22
Writing a Persuasive E-mail
A pair of shoes that normally costs $75 is on sale for $55. What is the percent decrease in the price, to the nearest whole percent?
PLEASE HELP ME OUT RLLY NEED IT
what is a productive way to maintain a horizontal relationship
Which of the following is a common injury caused by a hard, sudden impact on the skin that ruptures small blood vessels underneath. Sprain Fracture Scrape/Cut B
Why does the headless horseman carry his head under his arm math riddle?
A smaller number is 3 less than half a larger number. The larger number is 10 times 1 less than the smaller number. Let x represent the smaller number, and let
what is an example of reference marker that a source might use?