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

Which of the following took place in both Egypt and the Incan empire? A. creation of currency B. abolition of slavery C. human sacrifice to the gods D. mumm
Can you help me with this question
2. Why do experiments need to have multiple trials?
sally has 24 cups of soup in a pot. if she pours 1/4 cup of soup into each bowl, how many bowls will be used?
Which of the following is true with respect to carbohydrate (glucose) ingestion? a. it decreases glucose availability for body cells. b. it is the least prefe
Is the mayor himself spoke to the crowd intensive or reflective pronoun
Y=10x. What is the constant of proportionality
What holds more half gallon or 2 liter
a set of written rules which set up a government is called a what?
Urbanization developed quickly in Southwestern Asia and Northern Africa, espcially since 1950. This is the case in Kuwait, where urban areas grew from 50 to __