mylist = [10, 20, 30]mylist.index(11)
A: SyntaxError
B: ValueError
C: TypeError
D: NameError
E: No error is raised
A: SyntaxError
B: ValueError
C: TypeError
D: NameError
E: No error is raised
举一反三
- What kind of error will be given by running the next code?>>> a = 3print(a ** b)() A: IndexError B: ValueError C: TypeError D: NameError
- 设myList=[’java’,12,’Python’],则myList [1]值是______ ,myList[:2]值是(’java’,12)。
- 一个except语句块可以处理多个异常吗?() A: 是,比如TypeError,SyntaxError[,…] B: 是,比如[TypeError,SyntaxError] C: 是,比如(TypeError,ValueError) D: 不能
- 下列程序运行后,会产生( )异常。 A: NameError B: SyntaxError C: IndexError D: ValueError
- Given: int[] myArray=newint[] {1, 2,3,4, 5}; What allows you to create a list from this array?() A: List myList = myArray.asList(); B: List myList = Arrays.asList(myArray); C: List myList = new ArrayList(myArray); D: List myList = Collections.fromArray(myArray);