Solved

Case Study 2: 1. Def MaybeAdd(ch, ToList)

Question 11

Multiple Choice

Case Study 2:
1. def maybeAdd(ch, toList) :
2. if ch in 'abcdefghijklmnopqrstuvwxyz'
and ch not in toList:
3. toList.append (ch)
-Refer to the session in the accompanying Case Study 2. What is the value of myList after the following code is executed?
>>> myList
['a', 'b']
>>> maybeAdd('a', myList)


A) ['a', 'a', 'b']
B) ['a', 'b']
C) ['abcdefghijklmnopqrstuvwxyz']
D) None

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions