ProgrammingHardTCS CodeVita · Infosys HackWithInfy
What is printed?
What is printed?
from math import comb print(comb(4, 2) * comb(4, 2), comb(8, 4) - comb(8, 3))
- A. 16 14
- B. 12 14
- C. 36 14
- D. 36 13
Correct answer: C. 36 14
comb(4, 2) = 6, so the product is 36. comb(8, 4) = 70 and comb(8, 3) = 56, so the difference is 14.
More Python Programming questions
- What is printed? python print(list(map(lambda p: p[0] + p[1], zip([1, 2], [10, 20, 30]))))
- What is printed? python s = 'a1b2c3' letters = ''.join(c for c in s if c.isalpha()) digits = sum(int(c) for c in s if c.isdigit())…
- What is printed? python def f(a, args, key=None, kw): return (a, args, key, sorted(kw)) print(f(1, 2, 3, key='k', z=0, y=9))
- What is printed? python print(bool(0.0), bool(-0.0), bool(1e-300), bool(float('nan')))
- What is printed? python print(sum(i i for i in range(1, 4)), sum(i 2 for i in range(1, 4)) == 14)
- What is printed? python print(round(1234.5678, -2), round(-1.5), round(-2.5), round(0.1 + 0.2, 1))