Suppose list1 = [0.5 * x for x in range(0, 4)], list1 is:
1. [0, 1, 2, 3]
2. [0, 1, 2, 3, 4]
3.[0.0, 0.5, 1.0, 1.5]
4.[0.0, 0.5, 1.0, 1.5, 2.0]
Posted Date:-2021-12-30 22:18:48
Suppose list1 is [3, 5, 25, 1, 3], what is min(list1)?
1. 3
2. 5
3.25
4. 1
Posted Date:-2021-12-30 22:15:11
Suppose listExample is [‘h’,’e’,’l’,’l’,’o’], what is len(listExample)?
1. 5
2.4
3.None
4. Error
Posted Date:-2021-12-30 22:14:24
To insert 5 to the third position in list1, we use which command?
1. list1.insert(3, 5)
2. list1.insert(2, 5)
3.list1.add(3, 5)
4. list1.append(3, 5)
Posted Date:-2021-12-30 22:20:01
What will be the output of the following Python code snippet? print('ab cd ef'.splitlines())
1. [‘ab’, ‘cd’, ‘ef’]
2. [‘ab ’, ‘cd ’, ‘ef ’]
3.[‘ab ’, ‘cd ’, ‘ef’]
4. [‘ab’, ‘cd’, ‘ef ’]
Posted Date:-2021-12-30 10:36:36
What will be the output of the following Python code snippet? print('abcdef12'.replace('cd', '12'))
1.ab12ef12
2.abcdef12
3. ab12efcd
4.none of the mentioned
Posted Date:-2021-12-30 10:27:43
What will be the output of the following Python code snippet? print('abef'.replace('cd', '12'))
1.abef
2.12
3.error
4.none of the mentioned
Posted Date:-2021-12-30 10:28:07
What will be the output of the following Python code? >>>names = ['Amir', 'Bear', 'Charlton', 'Daman'] >>>print(names[-1][-1])
1.A
2.Daman
3.Error
4. n
Posted Date:-2021-12-30 22:17:54
What will be the output of the following Python code? print('cba'.maketrans('abc', '123'))
1.{97: 49, 98: 50, 99: 51}
2.{65: 49, 66: 50, 67: 51}
3.321
4.123
Posted Date:-2021-12-30 10:16:02
Which of the following commands will create a list?
1. list1 = list()
2. list1 = list()
3. list1 = list([1, 2, 3])
4.all of the mentioned
Posted Date:-2021-12-30 22:13:36
Suppose list1 is [1, 3, 2], What is list1 * 2?
1.[2, 6, 4]
2. [1, 3, 2, 1, 3]
3.[1, 3, 2, 1, 3, 2]
4. [1, 3, 2, 3, 2, 1]
Posted Date:-2021-12-30 22:18:22
Suppose list1 is [1, 5, 9], what is sum(list1)?
1.1
2.9
3.15
4. Error
Posted Date:-2021-12-30 22:15:34
Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]?
1.Error
2.None
3.25
4.2
Posted Date:-2021-12-30 22:16:54
Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?
1. [2, 33, 222, 14]
2. Error
3.25
4. [25, 14, 222, 33, 2]
Posted Date:-2021-12-30 22:17:24
Suppose list1 is [2445,133,12454,123], what is max(list1)?
1. 2445
2. 133
3.12454
4.123
Posted Date:-2021-12-30 22:14:47
Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.reverse()?
1. [3, 4, 5, 20, 5, 25, 1, 3]
2.[1, 3, 3, 4, 5, 5, 20, 25]
3.[25, 20, 5, 5, 4, 3, 3, 1]
4. [3, 1, 25, 5, 20, 5, 4, 3]
Posted Date:-2021-12-30 22:21:51
Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1.count(5)?
1.0
2.4
3.1
4.2
Posted Date:-2021-12-30 22:21:04
Suppose list1 is [3, 4, 5, 20, 5], what is list1.index(5)?
1.0
2.1
3.4
4.2
Posted Date:-2021-12-30 22:20:46
Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?
1. print(list1[0])
2. print(list1[:2])
3. print(list1[:-2])
4.all of the mentioned
Posted Date:-2021-12-30 22:16:26
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.extend([34, 5])?
1.[3, 4, 5, 20, 5, 25, 1, 3, 34, 5]
2.[1, 3, 3, 4, 5, 5, 20, 25, 34, 5]
3. [25, 20, 5, 5, 4, 3, 3, 1, 34, 5]
4.[1, 3, 4, 5, 20, 5, 25, 3, 34, 5]
Posted Date:-2021-12-30 22:22:13
Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop(1)?
1.[3, 4, 5, 20, 5, 25, 1, 3]
2.[1, 3, 3, 4, 5, 5, 20, 25]
3.[3, 5, 20, 5, 25, 1, 3]
4.[1, 3, 4, 5, 20, 5, 25]
Posted Date:-2021-12-30 22:22:38
To add a new element to a list we use which command?
1. list1.add(5)
2.list1.append(5)
3.list1.addLast(5)
4. list1.addEnd(5)
Posted Date:-2021-12-30 22:19:36
To remove string “hello” from list1, we use which command?
1. list1.remove(“hello”)
2. list1.remove(“hello”)
3.list1.removeAll(“hello”)
4. list1.removeOne(“hello”)
Posted Date:-2021-12-30 22:20:23
To shuffle the list(say list1) what function do we use?
1. list1.shuffle()
2. shuffle(list1)
3. random.shuffle(list1)
4. random.shuffleList(list1)
Posted Date:-2021-12-30 22:15:59
What is the output when we execute list(“hello”)?
1.[‘h’, ‘e’, ‘l’, ‘l’, ‘o’]
2. [‘hello’]
3. [‘llo’]
4. [‘olleh’]
Posted Date:-2021-12-30 22:13:59
What will be the output of the following Python code snippet? print('ab cd ef'.title())
1.Ab cd ef
2.Ab cd eF
3.Ab Cd Ef
4.none of the mentioned
Posted Date:-2021-12-30 10:37:25
What will be the output of the following Python code snippet? print('ab cd-ef'.title())
1.Ab cd-ef
2. Ab Cd-ef
3.Ab Cd-Ef
4.none of the mentioned
Posted Date:-2021-12-30 10:38:06
What will be the output of the following Python code snippet? print('Ab!2'.swapcase())
1. AB!@
2. ab12
3.aB!2
4.aB1@
Posted Date:-2021-12-30 10:37:02
What will be the output of the following Python code snippet? print('abcd'.translate('a'.maketrans('abc', 'bcd')))
1.bcde
2.abcd
3.error
4.bcdd
Posted Date:-2021-12-30 10:38:26
What will be the output of the following Python code snippet? print('abcdefcdghcd'.split('cd', -1))
1. [‘ab’, ‘ef’, ‘gh’]
2.[‘ab’, ‘ef’, ‘gh’, ”]
3.(‘ab’, ‘ef’, ‘gh’)
4.(‘ab’, ‘ef’, ‘gh’, ”)
Posted Date:-2021-12-30 10:33:31
What will be the output of the following Python code snippet? print('abcdefcdghcd'.split('cd', 0))
1. [‘abcdefcdghcd’]
2.‘abcdefcdghcd’
3. error
4.none of the mentioned
Posted Date:-2021-12-30 10:31:23
What will be the output of the following Python code snippet? print('abcdefcdghcd'.split('cd', 2))
1. [‘ab’, ‘ef’, ‘ghcd’]
2. [‘ab’, ‘efcdghcd’]
3. [‘abcdef’, ‘ghcd’]
4.none of the mentioned
Posted Date:-2021-12-30 10:36:10
What will be the output of the following Python code snippet? print('abcdefcdghcd'.split('cd'))
1. [‘ab’, ‘ef’, ‘gh’]
2.[‘ab’, ‘ef’, ‘gh’, ”]
3.(‘ab’, ‘ef’, ‘gh’)
4.(‘ab’, ‘ef’, ‘gh’, ”)
Posted Date:-2021-12-30 10:30:23
What will be the output of the following Python code snippet? print('abcefd'.replace('cd', '12'))
1.ab1ef2
2.abcefd
3.ab1efd
4. ab12ed2
Posted Date:-2021-12-30 10:28:33
What will be the output of the following Python code snippet? print('abef'.partition('cd'))
1.(‘abef’)
2.(‘abef’, ‘cd’, ”)
3. (‘abef’, ”, ”)
4.error
Posted Date:-2021-12-30 10:26:41
What will be the output of the following Python code snippet? print('cd'.partition('cd'))
1.(‘cd’)
2.(”)
3.(‘cd’, ”, ”)
4.(”, ‘cd’, ”)
Posted Date:-2021-12-30 10:25:09
What will be the output of the following Python code snippet? print('Hello World'.istitle())
1. True
2.False
3.None
4.Error
Posted Date:-2021-12-30 08:19:58
What will be the output of the following Python code snippet? print('xyyxyyxyxyxxy'.replace('xy', '12', 0))
1. xyyxyyxyxyxxy
2.12y12y1212x12
3.12yxyyxyxyxxy
4.xyyxyyxyxyx12
Posted Date:-2021-12-30 10:29:12
What will be the output of the following Python code snippet? print('xyyxyyxyxyxxy'.replace('xy', '12', 100))
1.xyyxyyxyxyxxy
2.12y12y1212x12
3. none of the mentioned
4.error
Posted Date:-2021-12-30 10:29:37
What will be the output of the following Python code? >>>list1 = [11, 2, 23] >>>list2 = [11, 2, 2] >>>list1 < list2
1. True
2.False
3.Error
4.None
Posted Date:-2021-12-30 22:19:11
What will be the output of the following Python code? print(''' foo'''.lstrip())
1. foo
2.foo
3. foo
4.none of the mentioned
Posted Date:-2021-12-30 08:23:00
What will be the output of the following Python code? print(''' foo'''.lstrip())
1. foo
2.foo
3. foo
4.none of the mentioned
Posted Date:-2021-12-30 10:14:41
What will be the output of the following Python code? print('1Rn@'.lower())
1. n
2.1rn@
3.rn
4.r
Posted Date:-2021-12-30 08:21:43
What will be the output of the following Python code? print('a'.maketrans('ABC', '123'))
1.{97: 49, 98: 50, 99: 51}
2.{65: 49, 66: 50, 67: 51}
3.{97: 49}
4.1
Posted Date:-2021-12-30 10:16:30
What will be the output of the following Python code? print('abcd'.partition('cd'))
1. (‘ab’, ‘cd’, ”)
2.(‘ab’, ‘cd’)
3.error
4.none of the mentioned
Posted Date:-2021-12-30 10:24:31
What will be the output of the following Python code? print('abcdef'.partition('cd'))
1. (‘ab’, ‘ef’)
2.(‘abef’)
3.(‘ab’, ‘cd’, ‘ef’)
4.2
Posted Date:-2021-12-30 10:23:33
What will be the output of the following Python code? print('abcdefcdgh'.partition('cd'))
1.(‘ab’, ‘cd’, ‘ef’, ‘cd’, ‘gh’)
2.(‘ab’, ‘cd’, ‘efcdgh’)
3. (‘abcdef’, ‘cd’, ‘gh’)
4.error
Posted Date:-2021-12-30 10:24:07
What will be the output of the following Python code? print('Hello!2@#World'.istitle())
1. True
2. False
3. None
4.error
Posted Date:-2021-12-30 08:21:12
What will be the output of the following Python code? print('xyxxyyzxxy'.lstrip('xyy'))
1.zxxy
2.xyxxyyzxxy
3.xyxzxxy
4.none of the mentioned
Posted Date:-2021-12-30 10:15:39
What will be the output of the following Python code? print('xyyzxxyxyy'.lstrip('xyy'))
1.error
2. zxxyxyy
3.z
4.zxxy
Posted Date:-2021-12-30 10:15:15