Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Python code snippet?
k = [print(i) for i in my_string if i not in “aeiou”]

What will be the output of the following Python code snippet?
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)

Answer: c
Explanation: print(i) is executed if the given character is not a vowel.

Join The Discussion