Recent questions tagged goclasses-da-dpp-day-208

2 2 votes
1 1 answer
155
155 views
Consider the following Python code:A = {1, 2, 3, 4, 5} B = {4, 5, 6} C = {x * x for x in A if x % 2 == 1} print(sorted(A & B), sorted(A - B), sorted(C | {4}))What is the ...
1 1 vote
1 1 answer
109
109 views
Consider the following Python code:fruits = {"apple", "banana"} fruits.add("apple") fruits.update(["cherry", "apple"], "go") fruits.discard("mango") fruits.remove("banana...
3 3 votes
1 1 answer
112
112 views
Consider the following Python code:word = "banana" s = set(word) print(len(s), "b" in s, sorted(s))What is the output of the code above?3 True ['a', 'b', 'n']6 True ['a',...
2 2 votes
1 1 answer
104
104 views
Consider the following Python code:s = {1, (2, 3), [4, 5]} print(len(s))What is the output of the code above?32{1, (2, 3), [4, 5]}TypeError
4 4 votes
1 1 answer
118
118 views
Consider the following Python code:nums = {3, 1, 2, 3, 2} nums.add(4) nums.add(2) print(len(nums), 2 in nums, sorted(nums))What is the output of the code above?5 True [1,...
To see more, click for the full list of questions or popular tags.