Chat
Metrics

Debugging Challenges:

Challenge 1: Missing Parenthesis

Problem Statement:

Identify the error in the following Python code:

def add(a, b:

 return a + b

+

Debugging Challenges:

Challenge 2: Incorrect Loop Logic

Problem Statement:

Spot the mistake in this JavaScript for-loop:

for(var i = 1; i > 10; i++) {

 console.log(i);

}

+

Debugging Challenges:

Challenge 3: Incorrect Data Type

Problem Statement:

Find the error in the following Java method:

public int divide(int a, int b) {

 return a / b;

}

+

Debugging Challenges:

Challenge 4: Logic Error in Condition

Problem Statement:

Identify the logical error in the following C# method:

public bool IsLeapYear(int year) {

 if(year % 4 == 0 && year % 100 != 0 || year % 400 = 0) {

  return true;

 }

 return false;

}

+

Programming Challenges:

Challenge 1: Reverse a String

Problem Statement:

Write a function that takes a string as input and returns that string in reverse order.

Input:

- A single string s where 1 ≤ len(s) ≤ 1000.

Output:

- A string representing the reversed version of s.

Example:

Input: "Hello"

Output: "olleH"

+

Programming Challenges:

Challenge 2: Palindrome Check

Problem Statement:

Write a function that determines if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequences of characters which reads the same backward or forward.

Input:

- A single string s where 1 ≤ len(s) ≤ 1000.

Output:

- "True" if the string is a palindrome, "False" otherwise.

Example:

Input: "radar"

Output: "True"

Input: "apple"

Output: "False"

+

Programming Challenges:

Challenge 3: Fibonacci Series

Problem Statement:

Write a function that generates the Fibonacci series up to n numbers. The Fibonacci sequence starts with 0 and 1, and every subsequent number is the sum of the two preceding ones.

Input:

- An integer n where 1 ≤ n ≤ 50.

Output:

- A list of integers representing the Fibonacci series up to n numbers.

Example:

Input: 5

Output: [0, 1, 1, 2, 3]

+