# What will be the output of the following Python code def f(values): values[0] = 44 v = [1, 2, 3] f(v) print(v)

1.  [1, 44]

2.  [1, 2, 3, 44]

3.  [44, 2, 3]

4.  [1, 2, 3]

4

[44, 2, 3]

Explanation :
No Explanation available for this question

# What will be the output of the following Python code def f(i, values = []): values.append(i) return values f(1) f(2) v = f(3) print(v)

1.  [1] [2] [3]

2.  [1] [1, 2] [1, 2, 3]

3.  [1, 2, 3]

4.  1 2 3

4

[1, 2, 3]

Explanation :
No Explanation available for this question

# What will be the output of the following Python code names1 = ['Amir', 'Bala', 'Chales'] if 'amir' in names1: print(1) else: print(2)

1.  None

2.  1

3.  2

4.  Error

4

2

Explanation :
No Explanation available for this question

# What will be the output of the following Python code names1 = ['Amir', 'Bala', 'Charlie'] names2 = [name.lower() for name in names1] print(names2[2][0])

1.  None

2.  a

3.  b

4.  c

4

c

Explanation :
No Explanation available for this question

# What will be the output of the following Python code numbers = [1, 2, 3, 4] numbers.append([5,6,7,8]) print(len(numbers))

1.  4

2.  5

3.  8

4.  12

4

5

Explanation :
No Explanation available for this question

# To which of the following the “in” operator can be used to check if an item is in it

1.  Lists

2.  Dictionary

3.  Set

4.  All of the mentioned

4

All of the mentioned

Explanation :
No Explanation available for this question

# What will be the output of the following Python code list1 = [1, 2, 3, 4] list2 = [5, 6, 7, 8] print(len(list1 + list2))

1.  2

2.  4

3.  5

4.  8

4

8

Explanation :
No Explanation available for this question

# What will be the output of the following Python code def addItem(listParam): listParam += [1] mylist = [1, 2, 3, 4] addItem(mylist) print(len(mylist))

1.  1

2.  4

3.  5

4.  8

4

5

Explanation :
No Explanation available for this question

# What will be the output of the following Python code def increment_items(L, increment): i = 0 while i < len(L): L[i] = L[i] + increment i = i + 1 values = [1, 2, 3] print(increment_items(values, 2)) print(values)

1.  None[3, 4, 5]

2.  None[1, 2, 3]

3.  [3, 4, 5][1, 2, 3]

4.  [3, 4, 5]None

4

None
[3, 4, 5]

Explanation :
No Explanation available for this question

# What will be the output of the following Python code def example(L): ''' (list) -> list ''' i = 0 result = [] while i < len(L): result.append(L[i]) i = i + 3 return result

1.  Return a list containing every third item from L starting at index 0

2.  Return an empty list

3.  Return a list containing every third index from L starting at index 0

4.  Return a list containing the items from L starting from index 0, omitting every third item

4