0% found this document useful (0 votes)
308 views1 page

Solution of Kubernates Solutions

This document contains questions from a Python assessment. Question 8 asks which Python C API function will not always return NULL. Question 9 gives Python code and asks for the output. The code defines a function that appends a value to a list and returns the list. It is called with different arguments and the output is listed. Question 10 asks which two dictionary object methods return 0 on success and -1 on failure.

Uploaded by

mahesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
308 views1 page

Solution of Kubernates Solutions

This document contains questions from a Python assessment. Question 8 asks which Python C API function will not always return NULL. Question 9 gives Python code and asks for the output. The code defines a function that appends a value to a list and returns the list. It is called with different arguments and the output is listed. Question 10 asks which two dictionary object methods return 0 on success and -1 on failure.

Uploaded by

mahesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Digital : Python_Intermediate_iON LX_Async_&_SP_Assessment - Course ID: 54196

CLP - Python - Generic - SelfPaced - Assessment Only - E2 Batch 1

Question 8

Which of the following Python?C API functions will NOT always return NULL?

1. PyObject* PyErr_Format (PyObject *exception, const char *format, ...)


2. PyObject*PyErr_SetFromErrWithFilename(PyObject *type, const char *filename)
3. PyObject*PyErr_SetFromWindowsErr(omt ierr)
4. PyObject*PyErr_NewException(Chair *name, PyObject *base, PyObject * dict)
5. PyObject*PyErr_SelfFromErrno(PyObject *type)

Question 9

What is the output of the following code ? (Output values marked by ??)

 def abc(val, y=[[])


y.append(val)
return.y
 abc(3)

??

 abc(4,[1,2])

??

 abc(10)

??

1. [3], [1, 2, 3, 4], [1, 2, 3, 4, 10]


2. [3], [3, 1, 2], [3, 1, 2, 4]
3. [3], [1, 2, 4], [10]
4. [3], [1, 2, 3], [3, 10]

Question 10

Which two of the following dictionary object return “0” on success and “-1” on failure? (Choose two)

1. int PDict_Setlem(PyObject *p, PyObject *key, Object *val)


2. Pyobject *PyDict_GetlemWithErro(PyObject *p, PyObject *key)
3. Pyobject *PyDict_New()
4. int PDict_DelltemShring(PyObject *p, const char *key)

This study source was downloaded by 100000813364844 from CourseHero.com on 01-23-2023 07:34:17 GMT -06:00

https://www.coursehero.com/file/104858499/Digital-Python-Intermediate-iON-LX-Async-SP-Assessment-8-10docx/
Powered by TCPDF (www.tcpdf.org)

You might also like