What is the output of the following code
if 'bar' in {'foo': 1, 'bar': 2, 'baz': 3}:
print(1)
print(2)
if 'a' in 'qux':
print(3)
print(4)
1
2
4
Error
1
2
3
4
4
Answers
Answered by
1
Answer:
What is the output of the following code
if 'bar' in {'foo': 1, 'bar': 2, 'baz': 3}:
print(1)
print(2)
if 'a' in 'qux':
print(3)
print(4)
1
2
4
Error
1
2
3
4
4
397
Answered by
0
The output of the above algorithm is :
1
2
4
Given:
if 'bar' in {'foo': 1, 'bar': 2, 'baz': 3}:
print(1)
print(2)
if 'a' in 'qux':
print(3)
print(4)
solution:
if 'bar' in {'foo': 1, 'bar': 2, 'baz': 3}:
print(1)
print(2)
if 'a' in 'qux':
print(3)
print(4)
The output of the above algorithm is :
1
2
4
Similar questions