Revision b9e82881-46fc-4768-b2e1-4c253efc57e6 - Stack Overflow
I have some text that I am trying to decode and encode in Python
import html.parser
original_tweet = "I luv my <3 iphone & you’re awsm
apple.DisplayIsAwesome, sooo happppppy 🙂
http://www.apple.com"
tweet = original_tweet.decode("utf8").encode('ascii', 'ignore')
I have entered the original tweet on one line in Spyder (Python 3.6)
I get the following message
AttributeError: 'str' object has no attribute 'decode'
Is there an alternative way to rewrite this code for Python 3.6?