Certified Data Engineer Associate Exam QuestionsBrowse all questions from this exam

Certified Data Engineer Associate Exam - Question 66


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 of the following code blocks can the data engineer use to complete this task?

Show Answer
Correct Answer: D

To create a Python function to add two integers and return the sum, you need to use the 'def' keyword to define the function. Inside the function, you use the 'return' statement to return the result of adding the two integers. The code block in option D correctly defines a function named 'add_integers', takes two parameters 'x' and 'y', adds them, and returns the result.

Discussion

6 comments
Sign in to comment
meow_akkOption: D
Oct 22, 2023

D is correct. if you get this answer wrong you need to learn the basics of python.

55f31c8Option: D
Nov 29, 2023

D : https://www.geeksforgeeks.org/python-functions/

SydOption: D
Oct 29, 2023

D is correct. https://www.w3schools.com/python/python_functions.asp

kz_dataOption: D
Dec 6, 2023

D is correct

azure_bimonsterOption: D
Jan 20, 2024

D is to choose here

UGOTCOOKIESOption: D
Jan 26, 2024

Python functions start with the def keyword followed by the function name. Function also ends with the return keyword.