Poisonal
Pass it along a thing worth keeping

Governor Meyer Announces 'Virtual Residency' Program For Corporations To Pay Taxes Without Actually Being Here

Initiative launched amid $400M budget shortfall, as state acknowledges 20% of revenue depends on companies that have never set foot in Delaware.

10 months ago • 8 min read

Ship a Hybrid App That Doesn't Feel Like One

Ship a Hybrid App That Doesn't Feel Like One

University Curricula Now Include Mandatory Quiz Prep

University Curricula Now Include Mandatory Quiz Prep

Multiple-Choice Quiz
01/06
Question 01

Which line contains a syntax error?

1. def calculate_sum(numbers)
2. total = 0
3. for num in numbers:
4. total += num
5. return total

A
Line 1
B
Line 3
C
Line 4
D
Line 5

Which line contains a syntax error?

1. def calculate_sum(numbers)
2. total = 0
3. for num in numbers:
4. total += num
5. return total

Your Answer
Correct Answer
Line 1
✗Incorrect
Explanation

Line 1 is missing a colon after the function definition. Python requires a colon at the end of function declarations. The correct syntax is `def calculate_sum(numbers):`

Score0/ 6
Question 02

Which line contains a syntax error?

1. const greeting = "Hello"
2. if (greeting === "Hello") {
3. console.log("Match found")
4. }
5. console.log(greeting)

A
Line 1
B
Line 2
C
Line 3
D
No error

Which line contains a syntax error?

1. const greeting = "Hello"
2. if (greeting === "Hello") {
3. console.log("Match found")
4. }
5. console.log(greeting)

Your Answer
Correct Answer
No error
✗Incorrect
Explanation

This JavaScript code is syntactically correct. All statements end with semicolons (optional in JS but present here), the if statement has proper braces, and the string comparison uses the correct === operator.

Score0/ 6
Question 03

Which line contains a syntax error?

1. for i in range(10)
2. if i % 2 == 0:
3. print(i)
4. else:
5. continue

A
Line 1
B
Line 2
C
Line 3
D
Line 5

Which line contains a syntax error?

1. for i in range(10)
2. if i % 2 == 0:
3. print(i)
4. else:
5. continue

Your Answer
Correct Answer
Line 1
✗Incorrect
Explanation

Line 1 is missing a colon at the end of the for loop declaration. Python requires a colon after all loop and conditional statements. The correct syntax is `for i in range(10):`

Score0/ 6
Question 04

Which line contains a syntax error?

1. function processData(data) {
2. let result = []
3. for (let i = 0, i < data.length, i++) {
4. result.push(data[i])
5. }
6. return result

A
Line 2
B
Line 3
C
Line 4
D
Line 6

Which line contains a syntax error?

1. function processData(data) {
2. let result = []
3. for (let i = 0, i < data.length, i++) {
4. result.push(data[i])
5. }
6. return result

Your Answer
Correct Answer
Line 3
✗Incorrect
Explanation

Line 3 uses commas instead of semicolons in the for loop syntax. JavaScript for loops require semicolons to separate initialization, condition, and increment. The correct syntax is `for (let i = 0; i < data.length; i++)`

Score0/ 6
Question 05

Which line contains a syntax error?

1. def validate_input(user_input)
2. if len(user_input) > 0:
3. return True
4. else:
5. return False

A
Line 1
B
Line 2
C
Line 3
D
Line 4

Which line contains a syntax error?

1. def validate_input(user_input)
2. if len(user_input) > 0:
3. return True
4. else:
5. return False

Your Answer
Correct Answer
Line 1
✗Incorrect
Explanation

Line 1 is missing a colon after the function definition. Python syntax requires a colon at the end of `def` statements. The correct syntax is `def validate_input(user_input):`

Score0/ 6
Question 06

Which line contains a syntax error?

1. const obj = {
2. name: "Alice",
3. age 25,
4. city: "Boston"
5. }

A
Line 2
B
Line 3
C
Line 4
D
Line 5

Which line contains a syntax error?

1. const obj = {
2. name: "Alice",
3. age 25,
4. city: "Boston"
5. }

Your Answer
Correct Answer
Line 3
✗Incorrect
Explanation

Line 3 uses an equals sign instead of a colon between the property and value. JavaScript object literal syntax requires colons to separate keys from values. The correct syntax is `age: 25,`

Score0/ 6

why memorizing syntax is a waste of time

why memorizing syntax is a waste of time

The Syntax of Logic: Why Compilers Are Just Highly Strict Bureaucrats

The Syntax of Logic: Why Compilers Are Just Highly Strict Bureaucrats

AI Model Fails Own Beginner Coding Quiz

AI Model Fails Own Beginner Coding Quiz

how multiple choice quizzes ruin actual problem solvers

how multiple choice quizzes ruin actual problem solvers

New Study Finds Particleboard Life Expectancy Drops Sharply After First Move

New Study Finds Particleboard Life Expectancy Drops Sharply After First Move

Consumer Reports Issues Warning Against 'Heirloom Quality' Label on Assemble-at-Home Products

Consumer Reports Issues Warning Against 'Heirloom Quality' Label on Assemble-at-Home Products

IKEA Manuals Increase in Length by 14% Per Annum

IKEA Manuals Increase in Length by 14% Per Annum

The flatpack revolution

The flatpack revolution

Department of Commerce Notes Domestic Wood Prices Now Unlinked to Trees

Department of Commerce Notes Domestic Wood Prices Now Unlinked to Trees

The stolen dowel

The stolen dowel

Modern Apartment Living Rooms Found to Be 34% Empty Space

Modern Apartment Living Rooms Found to Be 34% Empty Space

Living with the wood

Living with the wood

The unfinished chair

The unfinished chair

More from Delaware