adplus-dvertising
frame-decoration

Question

What is the output of the following?
k = [print(i) for i in my_string if i not in "aeiou"]

a.

prints all the vowels in my_string

b.

prints all the consonants in my_string

c.

prints all characters of my_string that aren’t vowels

d.

prints only on executing print(k)

Posted under Python

Answer: (c).prints all characters of my_string that aren’t vowels

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the following?