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

A cannon fires a shell at 150 m/s at an angle of 20 degrees to the horizontal. How long is the cannon ball in the air if it lands in the ground level with the m
2. Write the definition of Article with example.
Transform positive sentences into negative sentences: 1. she is tall​
what is structure of the atom and charge of relative mass
Base your answers on the diagrams below of two cells, X and Y, and on your knowledge of biology. Select one lettered organelle and write the letter of that org
what is the meaning of customer in marketing?
Do iron nails rust more in salt water than in vinegar? Please answer ASAP.
In terms of biochemistry, what is a codon?
Transform positive sentences into negative sentences: 1. she is tall​
When Faith takes tests, she often gets anxious about which questions she'll be asked to answer. How can she reduce this anxiety during tests? Should she take