keys, keys
key values, keys
keys, key values
key values, key values
s={abs}
s={4, ‘abc’, (1,2)}
s={2, 2.2, 3, ‘xyz’}
s={san}
What will be the output of the following Python code?
s={2, 5, 6, 6, 7}
s
{2, 5, 7}
{2, 5, 6, 7}
{2, 5, 6, 6, 7}
Error
TRUE
FALSE
Write a list comprehension for number and its cube for:
l=[1, 2, 3, 4, 5, 6, 7, 8, 9]
[x**3 for x in l]
[x^3 for x in l]
[x**3 in l]
[x^3 in l]
s={1, 2, 3}
s.update(4)
{1, 2, 3, 4}
{1, 2, 4, 3}
{4, 1, 2, 3}
pop
remove
update
sum
s={4>3, 0, 3-3}
all(s)
any(s)
True False
False True
True True
False False
x | y
x ^ y
x & y
x – y
What will be the output of the following Python code snippet?
z=set('abc$de') 'a' in z
True
False
No output
z=set('abc')
z.add('san') z.update(set(['p', 'q']))
z
{‘abc’, ‘p’, ‘q’, ‘san’}
{‘a’, ‘b’, ‘c’, [‘p’, ‘q’], ‘san}
{‘a’, ‘c’, ‘c’, ‘p’, ‘q’, ‘s’, ‘a’, ‘n’}
{‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘san’}
{a**2 for a in range(4)}
{1, 4, 9, 16}
{0, 1, 4, 9, 16}
{0, 1, 4, 9}
. What will be the output of the following Python code?
s1={3, 4}
s2={1, 2} s3=set() i=0 j=0 for i in s1: for j in s2: s3.add((i,j)) i+=1 j+=1
print(s3)
{(3, 4), (1, 2)}
{(4, 2), (3, 1), (4, 1), (5, 2)}
{(3, 1), (4, 2)}
discard
dispose
s2.issubset(s1)
s2.issuperset(s1)
s1.issuperset(s2)
s1.isset(s2)
What will be the output of the following Python code, if s1= {1, 2, 3}?
s1.issubset(s1)
d = {}
d = {“john”:40, “peter”:45}
d = {40:”john”, 45:”peter”}
All of the mentioned
d = {"john":40, "peter":45}
“john”, 40, 45, and “peter”
“john” and “peter”
40 and 45
d = (40:”john”, 45:”peter”)
"john" in d
None