Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Basic Python Coding
00:00
5 left

Basic Python Coding

EasyPython

Problem

Write basic Python code to solve a problem.

Implement sum_numbers(numbers), which receives a list of integers and returns the sum of its elements. Return 0 when the list is empty.

Input and Output

  • Input: a list of integers.
  • Output: one integer containing their sum.

Constraints

  • 0 <= len(numbers) <= 100
  • -10^9 <= numbers[i] <= 10^9
  • The input contains only integers

Function Signature

def sum_numbers(numbers):
Interviewer

Your question is Basic Python Coding. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.