Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

Python error "TypeError: 'encoding' is an invalid keyword argument for this function"

Asked by Anusha Acharya Apr 5, 2021 6.4K views 1 answer
Share

About this question

 I have a tine code snippet and it gives me the following error:

TypeError: 'encoding' is an invalid keyword argument for this function

code:

import numpy as np
trump = open('speeches.txt', encoding='utf8').read()
# display the data
print(trump)

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.