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's a good slogan for a dietitian (have dietitian in it) ?
Graph the line using intercepts: 4x-3y=12
Newtons third law of motion is also known as the law of ?
Fragment in this sentenceWith her heavy dictonary, Donna thumps the top other ancient computer monitor.  Whenever the color tint flickers from normal to sickly
Which of the following is formed at a collision zone?Continental rift valleyVolcanic island chainMountain rangeDeep-ocean trench
Which is the same as 0.08? A) 80% B) 80/100 C) 8% D) 0.8
What is a communicable disease ?
The gases in the air attracted to earth by gravity form layers called the ____
The gases in the air attracted to earth by gravity form layers called the ____
how is the expression of sex linked genes both  similar to and different from the expression of autosomal genes?