Vidyalelo
Python · Q135

Python Lists MCQs: Exam Practice for List Concepts

Programming · Python · question 135

Q135

What will be the output of the following Python code? l=["good", "oh!", "excellent!", "#450"] [n for n in l if n.isalpha() or n.isdigit()]

A.
['good', 'oh', 'excellent', '450' ]
B.
['good']
Answer
C.
['good', '#450']
D.
['oh!', 'excellent!', '#450']

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board