COPA programming in python Page-3 Question Bank

11.  What happens while trying to retrieve a value using the expression d[“susan”] in the following code?
d = {“ajay”:40, “vijay”:45}
निम्नलिखित कोड में अभिव्यक्ति d[“susan”] का उपयोग करके मान प्राप्त करने का प्रयास करते समय क्या होता है?
d = {“ajay”:40, “vijay”:45}  [NCVT Exam 24]

(A) Python raises a null exception
 पायथन एक शून्य अपवाद उठाता है
(B) It is executed fine and no exception is raised,
 इसे ठीक से क्रियान्वित किया गया है और कोई अपवाद नहीं उठाया गया है,
(C) Python raises a syntax error
 Python एक सिंटैक्स त्रुटि उत्पन्न करता है
(D) Python raises a KeyError exception
 Python एक KeyError अपवाद उठाता है

12.  Which character gives single-line comments in Python?
पायथन में कौन सा कैरेक्टर सिंगल-लाइन कमेंट देता है?  [NCVT Exam 25]

(A) /*
(B) !
(C) //
(D) #

13.  Which of the following is true for variable names in Python?
पायथन में वेरिएबल नामों के लिए निम्न में से कौन सा सही है?  [NCVT Exam 25]

(A) ( - ) and ( & ) are the only two special characters allowed
 ( - ) और ( & ) केवल दो विशेष करैक्टर की अनुमति है
(B) Start variable name by space
 वैरिएबल नाम को स्पेस से प्रारंभ करना
(C) Case-insensitive
 केस-इंसेन्सिटिव
(D) Unlimited Length
 असीमित लंबाई

14.  Which is the correct operator for power( ab )?
पॉवर( ab ) के लिए सही ऑपरेटर कौन सा है?  [NCVT Exam 25]

(A) a ^ * b
(B) a ^ b
(C) a**b
(D) a ^ ^ b

15.  Which of the following term is correct for the given code?
____.d = {
< key >: < value >,
< key >: < value >,
.
.
.
< key >: < value >
}
परिभाषित करने के लिए निम्नलिखित का उपयोग किया जाता है
____.d = {
< key >: < value >,
< key >: < value >,
.
.
.
< key >: < value >
}  [NCVT Exam 25]

(A) List
 लिस्ट
(B) Dictionary
 डिक्शनरी
(C) Group
 ग्रुप
(D) Tuple
 ट्यूपल

Previous 1 2 3