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

why had respect for the pope weakened in the late middle ages
According to the video, what are some qualities needed by Registered Nurses? Check all that apply compassion knowledge of laboratory techniques leadership skill
In the given diagram, what is the measure of ∠ABC of parallelogram ABCD?
how do i solve using the substitution method? x+y=-1 y=-2x
1. How much energy would be required to melt 450 grams of ice at 0°C? 2. How many joules of energy would be release as 325 grams of steam condenses to liquid wa
150 increased by 40%​
If $500 yields $51.76 in simple interest over 7yrs, what is the annual rate? Answer need to be rounded to the nearest thousandth
What is the following product? (21/7+316)(5./2+4-13)
What natural material do you need in order to make porcelain?
Nosotros bebimos agua