What arithmetic operators cannot be used with strings in Python

1.  *

2.  -

3.  +

4.  All of the mentioned

4

-

Explanation :
No Explanation available for this question

What will be the output of the following Python code print("abc. DEF".capitalize())

1.  Abc. def

2.  abc. def

3.  Abc. Def

4.  ABC. DEF

4

Abc. def

Explanation :
No Explanation available for this question

Which of the following statements is used to create an empty set in Python

1.  ( )

2.  [ ]

3.  { }

4.  set()

4

set()

Explanation :
No Explanation available for this question

What will be the value of ‘result’ in following Python program list1 = [1,2,3,4] list2 = [2,4,5,6] list3 = [2,6,7,8] result = list() result.extend(i for i in list1 if i not in (list2+list3) and i not in result) result.extend(i for i in list2 if i not in (list1+list3) and i not in result) result.extend(i for i in list3 if i not in (list1+list2) and i not in result)

1.  [1, 3, 5, 7, 8]

2.  [1, 7, 8]

3.  [1, 2, 4, 7, 8]

4.  error

4

[1, 3, 5, 7, 8]

Explanation :
No Explanation available for this question

To add a new element to a list we use which Python command

3.  list1.append(5)

4

list1.append(5)

Explanation :
No Explanation available for this question

What will be the output of the following Python code print('*', "abcde".center(6), '*', sep='')

1.  * abcde *

2.  *abcde *

3.  * abcde*

4.  * abcde *

4

*abcde *

Explanation :
No Explanation available for this question

What will be the output of the following Python code >>>list1 = [1, 3] >>>list2 = list1 >>>list1[0] = 4 >>>print(list2)

1.  [1, 4]

2.  [1, 3, 4]

3.  [4, 3]

4.  [1, 3]

4

[4, 3]

Explanation :
No Explanation available for this question

Which one of the following is the use of function in python

1.  Functions don’t provide better modularity for your application

2.  you can’t also create your own functions

3.  Functions are reusable pieces of programs

4.  All of the mentioned

4

Functions are reusable pieces of programs

Explanation :
No Explanation available for this question

Which of the following Python statements will result in the output: 6 A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

1.  A[2][1]

2.  A[1][2]

3.  A[3][2]

4.  A[2][3]

4

A[1][2]

Explanation :
No Explanation available for this question

What is the maximum possible length of an identifier in Python

1.  79 characters

2.  31 characters

3.  63 characters

4.  none of the mentioned

4