Python

Categories: Code Problem / Data Structures and Algorithms / Recursion (32) Code Problem / Data Structures and Algorithms / Binary Search (30) Code Problem / Data Structures and Algorithms / Linked Lists (26) Code Problem / Data Structures and Algorithms / Backtracking (26) Code Problem / Data Structures and Algorithms / Stacks and Queues (25) Code Problem / Data Structures and Algorithms / Hashing (24) Databases / SQL / Backup and Recovery (19) Code Problem / Data Structures and Algorithms / Arrays and Strings (19) Databases / SQL / Database Normalization (18) Code Problem / Data Structures and Algorithms / Time Complexity (17) Databases / SQL / Locking (16) Databases / SQL / Replication (15) Databases / SQL / SQL Queries (13) Code Problem / Data Structures and Algorithms / Graphs (13) Databases / SQL / Database Security (13)  More...

Recent solutions:

Check these solutions from our community:
Python / Data Manipulation DifficultyMedium Python
The function should take a list of integers as input and return the sum of the even integers in the list.
About this solution: This solution is optimal because it uses a generator expression to filter the list and sum the even numbers. This is optimal because it is a single pass through the list, and it does not require any additional memory. It is also very readable.
Jan 28
Python / Exception handling DifficultyMedium Python
This problem deals with finding the sum of all integers in a list that are greater than or equal to 10. An example input is given, as well as the expected output.
About this solution: The candidate's solution correctly solves the problem and returns the sum of the integers that are greater than or equal to 10. The candidate's approach is to iterate through the list and add the integers that are greater than or equal to 10 to a sum variable. This is a valid approach and the candidate's solution is complete.
Jan 28
Python / Modules and Packages DifficultyMedium Python
This Python function takes a list of integers as input and returns the largest number in the list.
About this solution: The candidate's solution correctly finds the largest number in the list. The candidate could have used the built-in max() function to find the largest number in the list.
Jan 28
Python / Web Development DifficultyMedium Python
This problem deals with finding the sum of all integers in a list that are greater than or equal to 10. An example input and output are provided.
About this solution: The candidate's solution correctly solves the problem. They iterate through the list, checking if each integer is greater than or equal to 10. If it is, they add it to the sum. This is a solid approach.
Jan 27
Python / Exception handling DifficultyMedium Python
This Python code snippet returns the sum of integers that are greater than or equal to 10 in a list.
About this solution: The candidate's solution correctly solves the problem. They iterate through the list, checking if each integer is greater than or equal to 10. If it is, they add it to the sum. This is a solid approach that would work well for this problem.
Jan 27
Python / REST APIs DifficultyMedium Python
Given a list of integers, this Python function will find the sum of the even numbers in the list.
About this solution: This solution correctly finds the sum of all even numbers in the given list. It uses a simple for loop to iterate through the list, checking if each number is divisible by 2 (i.e. is even), and if so, adding it to the running total. This is a straightforward and effective solution.
Jan 27
Python / Classes and Objects DifficultyMedium Python
This Python class implements a stack using a list. The stack supports the following operations: push, pop, size, and isEmpty.
About this solution: This solution is complete and solves the problem. The approach is straightforward and easy to understand.
Nov 26
Python / Exception handling DifficultyMedium Python
This problem is about writing a function that returns the sum of the elements in a list. If the list is empty, the function should return 0.
About this solution: This solution correctly returns the sum of the elements in the list. However, it is not robust and will not work if the list is empty. The function should check for an empty list and return 0 if the list is empty.
Nov 26