The print()
function returns None
. You are trying to index None. You can not, because 'NoneType' object is not subscriptable
.
Put the [0]
inside the brackets. Now you’re printing everything, and not just the first term.
More Related Contents:
- Python Script returns unintended “None” after execution of a function [duplicate]
- Is it possible to not return anything from a function in python?
- Why am getting an "elif" syntax error showing invalid syntax in python [closed]
- Why doesn’t this python code run infinite times? [closed]
- Searching for IP addresses in a file
- How to optimise my code efficiency to speed up large data file extraction programs?
- Error “Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)”
- Why is the id of a Python class not unique when called quickly?
- Freezing/Hanging tkinter GUI in waiting for the thread to complete
- Type hinting a collection of a specified type
- Using pickle.dump – TypeError: must be str, not bytes
- ‘str’ object has no attribute ‘decode’. Python 3 error?
- How do I convert a string into an f-string?
- Why doesn’t str.translate work in Python 3?
- Understand Python swapping: why is a, b = b, a not always equivalent to b, a = a, b?
- How do you use subprocess.check_output() in Python?
- Why do I get “List index out of range” when trying to add consecutive numbers in a list using “for i in list”? [duplicate]
- What does “SSLError: [SSL] PEM lib (_ssl.c:2532)” mean using the Python ssl library?
- Deep version of sys.getsizeof [duplicate]
- What is the correct syntax for ‘else if’?
- Get: TypeError: ‘dict_values’ object does not support indexing when using python 3.2.3 [duplicate]
- Find Out If a Function has been Called
- How to enable FIPS mode for libcrypto and libssl packaged with Python?
- Scrape Dynamic contents created by Javascript using Python
- TypeError: ufunc ‘add’ did not contain a loop with signature matching types
- AttributeError: module ‘numpy’ has no attribute ‘__version__’
- Install mod_wsgi on Ubuntu with Python 3.6, Apache 2.4, and Django 1.11
- Why are str.count(”) and len(str) giving different outputs when used on an empty string?
- Convert binary string to bytearray in Python 3
- ‘is’ operator behaves unexpectedly with floats