ProgrammingModerateTCS NQT · Wipro pattern
What is printed?
What is printed?
print(len(str(10**100 - 1)), str(10**5)[:3], int('9' * 50) % 9)- A. 100 100 0
- B. 99 100 0
- C. 100 10 0
- D. 100 100 9
Correct answer: A. 100 100 0
10**100 - 1 is one hundred nines, so its length is 100. A string of nines has a digit sum of 9 times its length, so it is divisible by 9.
More Python Programming questions
- What is printed? python print(round(1234.5678, -2), round(1234.5678, 2), round(-0.0001, 3), round(5.5), round(6.5))
- What is printed? python print(7.0 == 7, (7.0).isinteger(), (7.5).isinteger(), 1e3 == 1000)
- What is printed? python print(2 0.5 2 0.5 == 2, (2 0.5) 2, 2 0.5 2)
- What is printed? python print('%.2f' % 1.005, '%.2f' % 1.015, '%.2f' % 1.025, '%.1f' % 0.25)
- What is printed? python s = 'abc' t = s s += 'd' print(t, s, t is s, id(s) == id(t))
- What is printed? python def tosigned(v): return v - (1 << 32) if v >= 1 << 31 else v print(tosigned(0xFFFFFFFE), tosigned(0x7FFFFFFF)…