You are on page 1of 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:14:58 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