ProgrammingVery hardCAT · MBA placement
What is printed?
What is printed?
print(len(str(2**100)), str(2**100)[:5])
- A. 30 12676
- B. 31 12677
- C. 31 1267
- D. 31 12676
Correct answer: D. 31 12676
2^100 has 31 decimal digits and begins 12676, since 2^100 is 1267650600228229401496703205376.
More Python Programming questions
- What is printed? python print(sorted([[2, 'b'], [1, 'z'], [2, 'a']]))
- What is printed? python x = [1, 2, 3] y = x.copy() y.append(4) print(len(x), len(y), x is y)
- What is printed? python print('aaa' < 'b', 'abc' > 'abd')
- What is printed? python print(sum(1 for c in 'hello world' if c in 'aeiou'))
- What is printed? python print(list(filter(lambda x: x > 0, map(lambda x: x - 2, [1, 2, 3, 4]))))
- What is printed? python print(1e3, 1000.0 == 1e3, 10 -2)