📊

Logic Building - Phase 4: Basic Arrays

Practice array operations, searching, counting, and transformation logic

50 questions•5 pages•~75 min
Progress: 0 / 500%
Page 1 of 5 • Questions 1-10 of 50
Q1easy

What will be the output? arr = [10, 20, 30] print(arr[1])

Q2easy

What does this code do? arr = [5, 2, 8, 1, 9] max_val = arr[0] for num in arr: if num > max_val: max_val = num

Q3medium

What will be the result? arr = [1, 2, 3, 4, 5] sum = 0 for i in range(len(arr)): if i % 2 == 0: sum += arr[i]

Q4easy

What is the output?

arr = [1, 2, 3]
arr.append(4)
print(len(arr))
Q5medium

What does this code check? arr = [1, 2, 3, 2, 4] for i in range(len(arr)): if arr[i] == 2: print(i) break

Q6easy

What will be printed? arr = [1, 2, 3, 4, 5] print(arr[-1])

Q7easy

What is the output?

arr = [10, 20, 30]
arr[1] = 25
print(arr)
Q8easy

What will be printed? arr = [5, 2, 8, 1, 9] min_val = min(arr) print(min_val)

Q9medium

What does this code do? arr = [1, 2, 3, 4, 5] result = [x * 2 for x in arr]

Q10medium

What is the output?

arr = [1, 2, 3]
arr.append(4)
arr.insert(0, 0)
print(arr)
...