Solved

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

Question 24

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 = []
>>> maybeAdd('a', myList)


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

Correct Answer:

verifed

Verified

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

Related Questions