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

What is an object with a very high resistance classified as?
Which object would best be identified by a periodic Doppler shift in a star's spectrum along with a dip in the stars light intensity? a black hole a nebula a co
can someone please help ? (:
How do we call a very small video,that is repeating unlimitedely
An infant is 32.625 inches (in) long. Write this as a common fraction.
how can astronomers use rocks from the moon to estimate the age of the solar system ?
Given 4 percent of (2a + b) is 18 and a is a positive integer, what is the greatest possible value of b?
Whats the equation of a circle centered at (7,1) that passes through (-2,10)
Aside absorbing water and nutrients, what other functions do the roots serve?
If 5x^2 - 15x = 0 and x ≠ 0, find the value of x. (A) -10 (B) -3 (C) 10 (D) 5 (E) 3