Computer Science
Related Questions
What is a 2D list ?
What is a nested list ?
What will be the output of the following Python code ?
a = [10,23,56,[78, 10]] b = list(a) a[3][0] += 17 print(b)
- [10, 23, 71, [95, 10]]
- [10, 23, 56, [78, 25]]
- [10, 23, 56, [95, 10]]
- [10, 34, 71, [78, 10]]
What will be the output of the following Python code ?
lst1 = "hello" lst2 = list((x.upper(), len(x)) for x in lst1) print(lst2)
- [('H', 1), ('E', 1), ('L',1), ('L',1), ('O', 1)]
- [('HELLO', 5)]
- [('H',5), ('E', 5), ('L',5), ('L',5), ('O', 5)]
- Syntax error