How to fix AttributeError: 'str' object has no attribute 'decode' in Python

1 Answer

0 votes
s = "python"

# AttributeError: 'str' object has no attribute 'decode'
# print(s.decode())

print(s.encode().decode())




'''
run:

python

'''

 



answered Jan 31, 2022 by avibootz

Related questions

...