Certified Data Engineer Associate Exam QuestionsBrowse all questions from this exam

Certified Data Engineer Associate Exam - Question 106


A data engineer that is new to using Python needs to create a Python function to add two integers together and return the sum?

Which code block can the data engineer use to complete this task?

Show Answer
Correct Answer: CD

In Python, to define a function you use the 'def' keyword followed by the function name and parameters in parentheses. To add two integers and return the result, the function must include a 'return' statement that returns the sum of the parameters. The correct code block is 'def add_integers(x, y): return x + y', which meets these requirements.

Discussion

8 comments
Sign in to comment
helmerpaivaOption: D
May 10, 2024

Correct is D

Ivan_PetrovOption: D
May 10, 2024

Correct answer is D

nawfalbourassOption: D
May 23, 2024

RETURN is needed

jetplanesOption: D
May 9, 2024

The correct answer is D because the python function needs to provide a return for the function, so C is incorrect.

KunkaOption: D
May 11, 2024

Answer is D. C is wrong answer, as it missed return key workd

PreranaCOption: D
May 22, 2024

D, RETURN in Python needed

hussamAlHunaitiOption: D
Jun 9, 2024

Answer is D.

3fbc31bOption: D
Jul 8, 2024

For the function to perform the actions "RETURN" must be present.