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

Heat is released when H2 gas and O2 gas react to form H2O. Why? A. Breaking the H–H bond in H2 gas releases heat. B. Breaking the O–O bond in O2 gas releases he
Your friend is asked to differentiate between evaporation and boiling.what questions could you ask to make him to know the difference between evaporation and bo
What is the highest mountain on each continent?
A sound wave of 70 cm travels 840 m in 2.5 sec. What is the velocity and frequency of sound?
If 2/5 of a number is added to 1/3 of the same number ,the sum is 22. What is the number?
How did Niccolo Machiavelli’s book The Prince set him apart from other writers of the Renaissance?
example of onomatopoeia in the seven ages of man
explain in steps how to graph this linear inequality 2x+3y > -2
Which expression is equivalent to 27/125
What is the highest mountain on each continent?