Identify data type of ‘T’ in following line of Code: T = list(tuple([1,2,3])) print(type(T))
1.Tuple
2.List
3.Nested List
4.None of the above
Posted Date:-2021-12-12 06:15:09
List and String are different
1.in reference to their indexing
2. in reference to data type of elements they contain
3.Both of the above
4.None of the above
Posted Date:-2021-12-12 06:15:50
List can have elements of _____________ data types.
1.Same
2.Different
3.Both of the above
4.None of the above
Posted Date:-2021-12-12 06:16:31
Which command is used to add an element in List named L1
1.L1.add(4)
2.L1.append(4)
3. L1.new(4)
4.None of the above
Posted Date:-2021-12-12 05:24:41
Which mathematical operator is used to concatenate list?
1.+
2.//
3.**
4.None of the above
Posted Date:-2021-12-12 06:21:19
Write the output of the following : L = [[5, 7, 9, 1 ], [12, 23, 4, 9]] for r in L: r.reverse( ) for e in r: print(e, end = ” “)
1.1 9 7 5 9 4 23 12
2.1 9 7 5 9 4 23 12
3.Error
4.None of the above
Posted Date:-2021-12-12 06:47:11
Write the output of the following : L = ['Amit', 'anita', 'Sumant', 'Zaid'] print(max(L))
1.Zaid
2.Sumant
3.anita
4.Amit
Posted Date:-2021-12-12 06:40:10
Write the output of the following : L = [11, 21, 31, 41] L.extend([51,62,73,84]) print(len(L))
1.8
2.5
3.4
4.Error
Posted Date:-2021-12-12 06:52:54
Write the output of the following code : >>>L=[“Amit”,”Sumit”,”Naina”] >>>print(L[1:-1])
1.[‘Sumit’]
2.[a]
3.[Naina]
4.None of the above
Posted Date:-2021-12-12 05:17:20
Write the output of the following code : L=[0.5 * x for x in range(4)] print(L)
1.[0.0, 0.5, 1.0, 1.5]
2. (0,.5, 1, 1.5)
3. [0.0, 0.5, 1.0, 1.5, 2.0]
4.Error
Posted Date:-2021-12-12 05:20:14
Write the output of the following: T = [1,2,3,4] T1 = [3,4,5,6] T2 = T + T1 print(T2)
1.[1, 2, 3, 4, 5, 6]
2. [1, 2, 3, 4, 3, 4, 5, 6]
3.[4, 6, 8, 10]
4.Error
Posted Date:-2021-12-12 05:28:19
Write the output of the following: T = [1,2,3,4] T1=T T[0] = “A” print(T) print(T1)
1.['A', 2, 3, 4] [1, 2, 3, 4]
2.['A', 2, 3, 4] ['A', 2, 3, 4]
3.[1, 2, 3, 4] [1, 2, 3, 4]
4.Error
Posted Date:-2021-12-12 05:30:50
del statement can delete the following from the List?
1.Single Element
2.Multiple Elements
3.All elements along with List object
4.All the above
Posted Date:-2021-12-12 05:30:01
Fill in the blanks with same word in both places >>> import __________ >>> list1 = [1,2,3,4,5] >>> list2 = _________copy(list1) >>> list2
1.copy
2.pickle
3.math
4.None of the above
Posted Date:-2021-12-12 06:36:43
How many elements will be there in list ‘L’ L = [[p, q] for p in (0, 4) for q in (0, 4)]
1.2
2.4
3.8
4.16
Posted Date:-2021-12-12 06:48:33
If we try to concatenate a list with elements of some other data type, _____________ occurs.
1.SyntaxError
2.SyntaxError
3.TypeError
4.None of the above
Posted Date:-2021-12-12 06:23:54
If we try to concatenate a list with elements of some other data type, _____________ occurs.
1.SyntaxError
2.SyntaxError
3.TypeError
4.None of the above
Posted Date:-2021-12-12 06:24:28
If we try to concatenate a list with elements of some other data type, _____________ occurs.
1.SyntaxError
2.SyntaxError
3.TypeError
4.None of the above
Posted Date:-2021-12-12 06:24:31
If we try to concatenate a list with elements of some other data type, _____________ occurs.
1.SyntaxError
2.SyntaxError
3.TypeError
4.None of the above
Posted Date:-2021-12-12 06:24:32
Name the operator which is used in the following print statement.
1.Concatenation
2.Repetition
3.Membership
4.None of the above
Posted Date:-2021-12-12 06:25:29
remove( ) function removes the _______________ occurrences of an element from the list
1.all
2.first
3.last
4.None of the above
Posted Date:-2021-12-12 06:34:07
The following statements is showing ______ operation in List. L1 = [1,2,3,4] L2 = [1,2,3,4] L = L1 + L2
1. Replication of List
2.Concatenation of String
3.Indexing of String
4.None of the above
Posted Date:-2021-12-12 06:20:27
Traversing a list can be done with the help of _____
1. loop
2.if
3.if–elif
4. None of the above
Posted Date:-2021-12-12 06:30:24
What type of error is returned by the following statement? T = [1,2,3,4] print(T.index(9))
1.IndexError
2.TypeError
3.ValueError
4.None of the above
Posted Date:-2021-12-12 05:33:17
What we call the operation which is used to extract particular range from a sequence.
1.Slicing
2.range
3.Indexing
4.Replication
Posted Date:-2021-12-12 05:37:01
Which function returns the length of a list?
1.Len( )
2.length( )
3. len( )
4.Length( )
Posted Date:-2021-12-12 06:32:35
Which mathematical operator is used for repetition?
1.*
2.**
3.+
4.//
Posted Date:-2021-12-12 06:08:02
Which of the following command will insert 7 in third position of List L.
1.L.insert(3, 7)
2.L.insert(2, 7)
3.L.add(3, 7)
4.L.append(3, 7)
Posted Date:-2021-12-12 07:02:03
Which of the following function creates the new list?
1.sort( )
2.sorted( )
3. reverse( )
4.All the above
Posted Date:-2021-12-12 06:34:54
Which of the following function is used to shuffle the list ?
1.random( )
2.swap( )
3.shuffle( )
4.None of the above
Posted Date:-2021-12-12 07:00:06
Which of the following is not list operation?
1. Indexing
2.Slicing
3.Dividing
4.Concatenation
Posted Date:-2021-12-12 06:09:17
Which of the following is true about List data type in Python?
1. List is a Sequence data type
2.List is mutable
3. List can have elements of different data type
4.All the above
Posted Date:-2021-12-12 06:11:21
Which of the following statement will create list?
1.a. L1=list( )
2.L1=[1,2,3,4]
3.Both of the above
4.None of the above
Posted Date:-2021-12-12 04:35:21
Which of the following statement will generate the square of given list L ? L = [1, 2, 3, 4, 5]
1.[x ** 2 for x in L
2. [x * 2 for x in L]
3. [x ^ 3 for x in L
4.None of the above
Posted Date:-2021-12-12 06:59:24
Which of the following statement will return first element from right of list ‘L’?
1.L[0]
2.L[-1]
3.L[1]
4.None of the above
Posted Date:-2021-12-12 06:18:55
Which of the following statement will reverse the list L1?
1.L1[ : : 1]
2. L1[-1 : : -1]
3.L1[: : -1]
4.None of the above
Posted Date:-2021-12-12 06:29:37
Which of the following will give output as [21,2,9,7] ? if list L = [1,21,4,2,5,9,6,7]
1.print(L[1 : 8 : 2])
2.print(L[1 : : 2])
3.Both of the above
4.None of the above
Posted Date:-2021-12-12 06:39:23
Which operation of List is shown in following lines? L1 = [1, 2, 3, 4, 5, 6, 7, 8] print(L1[3 : 6])
1. Concatenation
2.Repetition
3.Slicing
4.None of the above
Posted Date:-2021-12-12 06:28:49
Which operator helps to check whether an element is present in list or not?
1.+
2. in
3. **
4.None of the above
Posted Date:-2021-12-12 06:26:21
Which statement will give the same output? list1 = [1, 2, 3, 4] list2 = [5, 6, 7, 8]
1. print(len(list1 + list2))
2. print(len(list1) + len (list2))
3.print(list2[3])
4.All the above
Posted Date:-2021-12-12 06:51:30
Write the output of the following L = ["Amit", 'Sumit', 'Ravi'] print("@".join(L))
1.@Amit
2.Amit@Sumit@Ravi
3.Amit@Sumit@Ravi@
4.None of the above
Posted Date:-2021-12-12 06:45:22
Write the output of the following L = ["Amit", 'Sumit', 'Ravi'] print(L[0][1])
1.A
2.Amit
3.s
4.m
Posted Date:-2021-12-12 06:43:57
Write the output of the following L = [14, 2, 3, 16, 15] L[1:4] = [5, 4, 8] print(L)
1.[14, 5, 4, 8, 15]
2. [14, 5, 4, 8, 2, 3, 16, 15]
3.Error
4.None of the above
Posted Date:-2021-12-12 06:43:12
Write the output of the following L1 = ['C++', 'C-Sharp', 'Visual Basic'] L2 = [name.upper() for name in L1] L3 = [name for name in L1] if(L2[2][0] == L3[2][0]): print("YES") else: print("N0")
1.NO
2.yes
3.Error
4.None of the above
Posted Date:-2021-12-12 06:53:25
Write the output of the following list1=[3,2,5,7,3,6] list1.insert(6,3) print(list1)
1.[3, 2, 5, 6, 7, 3, 6]
2. [3, 2, 5, 6, 3, 6]
3.[3, 2, 5, 7, 3, 6, 3]
4.None of the above
Posted Date:-2021-12-12 06:42:13
Write the output of the following : D = [1,2,3] D1 = D D.append(4) print(D1)
1.[1, 2, 3, 4]
2.[1, 2, 3]
3.Error
4.None of the above
Posted Date:-2021-12-12 06:35:44
Write the output of the following : D = list[ ] print(len(D))
1.0
2.1
3.SyntaxError
4.ValueError
Posted Date:-2021-12-12 06:33:28
Write the output of the following : def listchange(L): L.append(45) return L1 = [1, 2, 3, 4] listchange(L1) print(L1)
1.[1, 2, 3, 4]
2.[1, 2, 3, 45]
3. [1, 2, 3, 4, 45]
4.None of the above
Posted Date:-2021-12-12 06:37:46
Write the output of the following : L = [[1,2,3,5,6,7,[1,[2,3]]]] print(len(L))
1.4
2.3
3.2
4.1
Posted Date:-2021-12-12 06:31:45
Write the output of the following : L = [1,2,3,4,5,6,7,8,9,10] print(L[L[3]])
1.3
2.4
3.5
4.6
Posted Date:-2021-12-12 06:17:40
Write the output of the following : L = [11, 22, 33, 44, 55, 66] for i in range(1, 6): L[i - 1] = L[i]*2 for i in range(0, 4): print(L[i], end = " ")
1.44 66 88 110
2.22 33 44 55
3.11 22 33 44
4.Error
Posted Date:-2021-12-12 06:54:13
Write the output of the following : L = “123456” L = list(L) print(type(L[0]))
1.class ‘str’
2. class ‘int’
3.1
4.Error
Posted Date:-2021-12-12 05:25:59
Write the output of the following : L= [1,2,3,4,5] m = [m + 3 for m in L] print(m)
1.[4, 5, 6, 7, 8, 9]
2.[4, 5, 6, 7, 8, 9, 10]
3.[4, 5, 6, 7, 8]
4.Error
Posted Date:-2021-12-12 06:55:44
Write the output of the following : L= [1,2,3,4,5] m = [m and 1 for m in L] print(m)
1.[1, 2, 3, 4, 5]
2.[1, 1, 1, 1, 1]
3.[1, 0, 1, 0, 1
4.None of the above
Posted Date:-2021-12-12 06:55:00
Write the output of the following : L=["Amit","Sumit","Naina"] L1=["Sumit"] print(L - L1)
1.[“Amit” , “Naina”]
2.[“Amit” , “Naina”, “Sumit”]
3.Show Error
4.Error
Posted Date:-2021-12-12 06:04:56
Write the output of the following : L=[2 * x for x in range(3,14,3)] print(L)
1.[6, 12, 18, 24]
2.[6, 12, 18]
3.[6, 12, 18, 24, 30]
4.Error
Posted Date:-2021-12-12 05:37:58
Write the output of the following : L1 = [1, 2, 3, 4, 5] L2 = [9, 8, 7, 6, 5] S= [L1 + 3 for L1 in L2] print(S)
1.12, 11, 10, 9, 8]
2. [1, 2, 3, 4, 5, 6, 7, 8, 9]
3. [4, 5, 6, 7, 8]
4.Error
Posted Date:-2021-12-12 06:56:36
Write the output of the following : L1 = [1, 2, 3] L2 = [9, 8] S= [m * n for m in L1 for n in L2] print(S)
1.[9, 8, 18, 16, 27, 24]
2.[9, 18, 27, 8, 16, 24]
3.[8, 9, 16, 18, 24, 27]
4.Error
Posted Date:-2021-12-12 06:57:38
Write the output of the following : L1 = [1, 2, 3] L2 = [9, 8] S= [n + m for m in L1 for n in L1] print(S)
1.[2, 3, 4, 3, 4, 5, 4, 5]
2. [1, 2, 3, 2, 3, 4, 3, 4, 5]
3.[2, 3, 4, 3, 4, 5, 4, 5, 6]
4.Error
Posted Date:-2021-12-12 06:58:30
Write the output of the following : L1 = [1,2,3] L2=[5,6,7] L1 + L2 print(L1)
1.[1, 2, 3, 4, 5, 6, 7]
2.[1, 2, 3, 5, 6, 7]
3. [1, 2, 3]
4.None of the above
Posted Date:-2021-12-12 06:22:09
Write the output of the following code : >>> L=[‘w’,’e’,’l’,’c’,’o’,’m’,’e’] >>> print(len(L))
1.7
2.8
3.9
4.None
Posted Date:-2021-12-12 05:10:00
Write the output of the following code : >>> L=[“Amit”,”Anita”,”Zee”,”Longest Word”,123] >>> print(max(L))
1.Longest Word
2.Zee
3.Amit
4.Error
Posted Date:-2021-12-12 05:11:43
Write the output of the following code : >>> L=[“Amit”,”Anita”,”Zee”,”Longest Word”] >>> print(max(L))
1.Zee
2. Longest Word
3. Error
4.None of the above
Posted Date:-2021-12-12 05:10:58
Write the output of the following code : >>>L=[1,2,3,4,5,[6,7,8]] >>>print(L[5])
1.[6, 7, 8]
2.6, 7, 8
3.Error
4.6
Posted Date:-2021-12-12 05:13:25
Write the output of the following code : >>>L=[1,5,9] >>>print(sum(L),max(L),min(L))
1.15 9 1
2.Error
3.Max and Min are only for String Value
4.None of the above
Posted Date:-2021-12-12 05:12:29
Write the output of the following code : >>>L=[“Amit”,”Sumit”,”Naina”] >>>print(L[-1][-1])
1.[Naina]
2.[a]
3.a
4.None of the above
Posted Date:-2021-12-12 05:16:35
Write the output of the following code : >>>L=list(“www.csiplearninghub.com”) >>>print(L[20 : 0])
1.Error
2.No Value
3.None
4.[ ]
Posted Date:-2021-12-12 05:15:46
Write the output of the following code : L= [1*x for x in range(10,1,-4)] print(L)
1. [10, 6, 2]
2.[10, 7, 4]
3.Error
4.None of the above
Posted Date:-2021-12-12 05:22:09
Write the output of the following code : L=[1,2,3,4,5] for i in L: print(i,end=” “) i=i+1
1.1, 2, 3, 4, 5
2.1, 3, 5
3.Error
4.None of the above
Posted Date:-2021-12-12 05:22:56
Write the output of the following code : L=[‘a’ * x for x in range(4)] print(L)
1.[‘ ‘ , ‘a’ , ‘aa’ , ‘aaa’]
2. [‘a’, ‘aa’, ‘aaa’]
3.Error
4.None of the above
Posted Date:-2021-12-12 05:21:20
Write the output of the following code : L=[“Amit”,”Sumit”,”Naina”] L1=[“Sunil”] print(L + L1)
1.[‘Amit’ , ‘Sumit’ , ‘Naina’ , [‘Sunil’]]
2.[‘Amit’ , ‘Sumit’ , ‘Naina’ , ‘Sunil’]
3.List can not concatenate
4.None of the above
Posted Date:-2021-12-12 05:23:45
Write the output of the following code : L=[“Amit”,”Sumit”,”Naina”] print(L**2)
1. Error
2. [“Amit”,”Sumit”,”Naina”][“Amit”,”Sumit”,”Naina”]
3. [“Amit”,”Sumit”,”Naina”]
4.[“Amit”,”Sumit”,”Naina”,”Amit”,”Sumit”,”Naina”]
Posted Date:-2021-12-12 05:19:11
Write the output of the following code : L=[“Amit”,”Sumit”,”Naina”] print(L*2)
1. [‘Amit’, ‘Sumit’, ‘Naina’, ‘Amit’, ‘Sumit’, ‘Naina’]
2.[“Amit” , “Sumit” , “Naina”]
3.Error
4.None of the above
Posted Date:-2021-12-12 05:18:08
Write the output of the following code : L=list(“www.csiplearninghub.com”) print(L[20 : -1])
1.[‘c’ , ‘o’]
2.[‘c’ , ‘o’ , ‘m’]
3. (com)
4.Error
Posted Date:-2021-12-12 05:14:09
Write the output of the following code : list(“welcome”)
1.[‘w’, ‘e’, ‘l’, ‘c’, ‘o’, ‘m’, ‘e’]
2. (‘w’, ‘e’, ‘l’, ‘c’, ‘o’, ‘m’, ‘e’)
3.[‘welcome’]
4.None of the above
Posted Date:-2021-12-12 05:09:21
Write the output of the following: L = [[5, 7, 9, 1 ], [12, 23, 4, 9]] for r in L: r.sort() for e in r: print(e, end = ” “)
1.1 5 7 9 4 9 12 23
2. 1 4 5 7 9 9 12 23
3. 9 7 5 1 23 12 9 4
4.None of the above
Posted Date:-2021-12-12 06:47:56
Write the output of the following: L = [[p, q] for p in (0, 4) for q in (0, 4)] print(L[0])
1.[0]
2. [0, 4]
3. [4, 4]
4. [0, 0]
Posted Date:-2021-12-12 06:49:24
Write the output of the following: L = ['A', 'S', 'R'] L = L + L*2 print(L)
1.[‘A’, ‘S’, ‘R’, ‘2A’, ‘2S’, ‘2R’]
2. [‘A’, ‘S’, ‘R’, ‘A’, ‘S’, ‘R’, ‘A’, ‘S’, ‘R’]
3.[‘A’, ‘S’, ‘R’]
4.Error
Posted Date:-2021-12-12 06:46:17
Write the output of the following: L = [1,2,3,4,5,6,7,8,9,10] print(L[len(L) - 1])
1.9
2.1
3.Error
4.None of the above
Posted Date:-2021-12-12 06:19:32
Write the output of the following: L = [11, 21, 31, 41] L.append([51,62,73,84]) print(len(L))
1.8
2.5
3.4
4.None of the above
Posted Date:-2021-12-12 06:52:04
Write the output of the following: L = [23, 45, 65, 32, 3] L.insert(L[4], 'Monitor') print(L)
1.[23, 45, 65, ‘Monitor’, 32, 3]
2.[23, 45, 65, 32, ‘Monitor’, 3]
3.[23, 45, 65, 32, 3, ‘Monitor’]
4.None of the above
Posted Date:-2021-12-12 06:50:12
Write the output of the following: L =[['Physics',101],['Chemistry',202], ['Maths',303],45, 6, 'j'] print(len(L))
1.3
2.4
3.5
4.6
Posted Date:-2021-12-12 06:17:00
Write the output of the following: L=["Amit","Sumit","Naina"] L1=["Sunil"] print(L + L1)
1.[“Amit” , “Sumit” , “Naina” , [“Sunil”] ]
2.[‘Amit’ , ‘Sumit’ , ‘Naina’ , ‘Sunil’]
3.Error
4.[‘Amit’ , ‘Sumit’ , ‘Naina’ , ‘Sunil’][‘Amit’ , ‘Sumit’ , ‘Naina’ , ‘Sunil’]
Posted Date:-2021-12-12 05:35:14
Write the output of the following: L=[13, 12, 15, 27, 3, 46] list1.pop(3) print(L)
1.[13,12,15, 27, 46]
2.[13, 12, 15, 3, 46]
3.[13, 12, 15, 27, 3]
4.None of the above
Posted Date:-2021-12-12 06:40:59
Write the output of the following: list1=[3,2,5,7,3,6] list1.remove(3) print(sum(list1))
1.23
2.20
3.15
4.None of the above
Posted Date:-2021-12-12 06:41:28
Write the output of the following: print([] * 2 )
1.[ ]
2.0
3.Error
4.None of the above
Posted Date:-2021-12-12 06:38:29
Write the output of the following: print(1 in [[1],2,3])
1.True
2.False
3.Error
4.None of the above
Posted Date:-2021-12-12 06:26:59
Write the output of the following: print(len(tuple[1]))
1.1
2.0
3.Error
4.None of the above
Posted Date:-2021-12-12 06:31:17
Write the output of the following: T = [1,2,3,4] T1 = [3,4,5,6] T2 = T.append(T1) print(T2)
1. [1, 2, 3, 4, [3, 4, 5, 6]]
2.[1, 2, 3, 4, 3, 4, 5, 6]
3.None
4.None of the above
Posted Date:-2021-12-12 05:29:21
Write the output of the following: T=(1,2,3,4,5.5) L = list(T) print(L[3]*2.5)
1.Error
2.10
3.10.0
4.4
Posted Date:-2021-12-12 05:26:43
Write the output of the following: T=(1,2,3,4,5.5) L = list(T) print(L*2)
1.[2, 4, 6, 8, 11]
2. [1, 2, 3, 4, 5.5, 1, 2, 3, 4, 5.5]
3.Error
4.None of the above
Posted Date:-2021-12-12 05:27:32
Write the output of the following:
1. Error
2.14 + 9 -1
3.23
4.24
Posted Date:-2021-12-12 06:07:03
Write the output of the following:
1. Error
2.14 + 9 -1
3.23
4.24
Posted Date:-2021-12-12 06:07:04
Write the output of the following:
1. Error
2.14 + 9 -1
3.23
4.24
Posted Date:-2021-12-12 06:07:07
Write the output of the following. T = [1,2,3,4] T1=[5,6,7] L=T.append(T1) print(L)
1.None
2.[1, 2, 3, 4, [5, 6, 7]]
3. [ ]
4.Error
Posted Date:-2021-12-12 05:34:30