ProgrammingHardTCS CodeVita · Infosys HackWithInfy
What is printed?
What is printed?
print(len(str(10 ** 400 // 3)))
- A. 400
- B. 399
- C. 401
- D. 1
Correct answer: A. 400
10^400 divided by 3 is about 3.33 * 10^399, which has 400 digits. Integer division keeps the exact result.
More Python Programming questions
- What is printed? python print(1000000 == 10 6, 0x1F, 1e3 == 1000)
- What is printed? python print(oct(64), hex(-255), bin(0))
- What is printed? python print(ord('A') ^ 32, chr(ord('a') - 32))
- What is printed? python t = ([],) t[0].append(1) print(t, t[0] is t[0])
- What is printed? python print(list(dict.fromkeys('mississippi')))
- What is printed? python print(any([]) or all([]) and 'x')