ProgrammingVery hardProduct-company MCQ pattern
What is printed?
What is printed?
print(int('١٢٣') + 1, 'ß'.upper(), 'Dž'.lower(), len('ß'.upper()))- A. 124 ß dž 2
- B. 124 SS dž 2
- C. 123 SS dž 1
- D. 124 SS dž 1
Correct answer: B. 124 SS dž 2
int() accepts any Unicode decimal digits, so Arabic-Indic digits give 123. 'ß'.upper() becomes the two-character 'SS', and the digraph 'Dž' lowercases to 'dž'.
More Python Programming questions
- What is printed? python total = 0.0 for in range(10): total += 0.1 print(total, total == 1.0, sum([0.1] 10) == 1.0)
- Which of these is the best way to build a string from n pieces in CPython, and why?
- A program makes 10^5 membership checks of the form x in visited, where visited holds 10^5 items. Which statement is correct?
- What is printed? python def cnt(a, k): p, l, res = 1, 0, 0 for r, x in enumerate(a): p = x while l <= r and p >= k: p //= a[l] l += 1 res…
- What is printed? python g = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] n, m = 3, 3 P = [[0] (m + 1) for in range(n + 1)] for i in range(n): for j…
- What is printed? python def splits(a): total = sum(a) s = 0 c = 0 for x in a[:-1]: s += x if 2 s == total: c += 1 return c…