Question: Q1.What if, when calling a function of the form def func (a, b, c = 2) return a + b + c, do not specify

Q1.What if, when calling a function of the form

def func (a, b, c = 2)

return a + b + c,

do not specify the value of the argument c? (CHOOSE RIGHT ANSWER)

  1. it will default to 2
  2. It will take a random value
  3. Both of the above are correct
  4. None of the above

Q2.Suppose you define a tuple like the following: tup = (1, 2, 3, 4, 5)

Now you want to change the value of this tuple in the 2nd index to 10. Which of the following options would you choose? (CHOOSE RIGHT ANSWER)

  1. tup (2) = 10
  2. tup [2] = 10
  3. tup {2} = 10
  4. None of the above

Q3.Let's say you are given 2 lists - City_A and City_B.

City_A = ['1', '2', '3', '4']

City_B = ['2', '3', '4', '5']

Both cities have the same values. Which of the following codes will find the names of all cities that are present in "City_A" but not in "City_B".(CHOOSE RIGHT ANSWER)

  1. [i for i in City_A if i not in City_B]
  2. [i for i in City_B if i not in City_A]
  3. [i for i in City_A if i in City_B]
  4. None of the above

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!