如何创建ArrayList带整数和字符串输入类型?如果我创建一个:
List<Integer> sections = new ArrayList <Integer>();
Run Code Online (Sandbox Code Playgroud)
这将是一种Integer类型ArrayList.如果我创建一个:
List<String> sections = new ArrayList <String>();
Run Code Online (Sandbox Code Playgroud)
这将是String类型.如何创建一个ArrayList可以采用整数和字符串输入类型的?谢谢.
在 iPython 控制台中,我from nltk.book import输入了几个 LookupErrors。下面显示了我得到的代码。
*** Introductory Examples for the NLTK Book ***
Loading text1, ..., text9 and sent1, ..., sent9
Type the name of the text or sentence to view it.
Type: 'texts()' or 'sents()' to list the materials.
---------------------------------------------------------------------------
LookupError Traceback (most recent call last)
<ipython-input-3-8446809acbd4> in <module>()
----> 1 from nltk.book import*
C:\Users\dell\Anaconda\lib\site-packages\nltk-3.0.3-py2.7.egg\nltk\book.py in <module>()
20 print("Type: 'texts()' or 'sents()' to list the materials.")
21
---> 22 text1 = Text(gutenberg.words('melville-moby_dick.txt'))
23 print("text1:", text1.name)
24 …Run Code Online (Sandbox Code Playgroud)