From d303bb5a0cf3b6bfe2f6417d88c9d04b2881c54a Mon Sep 17 00:00:00 2001 From: charvi1234 <32154571+charvi1234@users.noreply.github.com> Date: Sat, 28 Oct 2017 09:08:52 +0530 Subject: [PATCH] Create python assign 2 --- python assign 2 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 python assign 2 diff --git a/python assign 2 b/python assign 2 new file mode 100644 index 0000000..3b0106f --- /dev/null +++ b/python assign 2 @@ -0,0 +1,20 @@ +Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32 +Type "copyright", "credits" or "license()" for more information. +>>> import binascii +>>> a="duyy8ugut8y29u" +>>> print(binascii.b2a_hex(a)) +Traceback (most recent call last): + File "", line 1, in + print(binascii.b2a_hex(a)) +TypeError: a bytes-like object is required, not 'str' +>>> import base 64 +SyntaxError: invalid syntax +>>> import base64 +>>> print(base64.b64encode(a)) +Traceback (most recent call last): + File "", line 1, in + print(base64.b64encode(a)) + File "C:\Users\Charika\AppData\Local\Programs\Python\Python36-32\lib\base64.py", line 58, in b64encode + encoded = binascii.b2a_base64(s, newline=False) +TypeError: a bytes-like object is required, not 'str' +>>>