What will be the output of the following Python code snippet? z=set(‘abc$de’) ‘a’ in z

Questions & AnswersCategory: Programming LanguageWhat will be the output of the following Python code snippet? z=set(‘abc$de’) ‘a’ in z
1 Answers
Geek Boy Staff answered 2 years ago

b. True
Explanation: The code shown above is used to check whether a particular item is a part of a given set or not. Since ‘a’ is a part of the set z, the output is true. Note that this code would result in an error in the absence of the quotes.