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

use the function rule, y= 2x+5, to find the values of y when x =1,2,3,4. write the answers as ordered pairs that would be used to graph the function. show your
If (x − 2)^2=49, then x could be ?
If A+B=76  and A -B=38 whats A divided by B
What does compris mean in French ???
How many corners are in a rectangle and how many flat faces
A special form of loose connective tissue that pads and insulates the body and stores fuel reserves is known as (A) epithelial tissue. (B) adipose tissue. (C) f
what were the main ideas of the reformation?
Which of the following stages of the cell cycle occurs immediately prior to mitosis? (A) G1 (B) G2 (C) S (D) M (E) cytokinesis Can you please explain with some
How did the Romans rule differently from the Etruscans?
How do you think the people conquered by the Romans felt about their new rulers