DEV Community

strings in python2 and python3

Tony Colston on January 15, 2020

I have written a lot of code in Python2. Not as much in Python3. One thing I used Python for a lot is to quickly convert string values into base64...
Collapse
 
cipharius profile image
Valts Liepiņš

Luckily you can type byte string literals in Python3: base64.b64encode(b'test')
That should make it as neat and simple as in Python2!

Collapse
 
tonetheman profile image
Tony Colston

Even better than mine! Good catch.