Quiz On Python Programming
Hello Everyone Most Welcome on my blog .Today I come with a new and interesting quiz competition . In This quiz competition everyone can participate . There is no any registration fee. There is no any time limit for this quiz . All The questions which are asked in this exam based on basic knowledge of Python Programming language. After Participating in this quiz competition everyone get a participation certificate on your Email Id.
About the Quiz
How to participate in this quiz:-
For Participating in this quiz competition first of all click on the quiz link which is given in the bottom of the post. After Clicking on the registration form will be open fill up the correct details in this registration form and after fill up the form start the quiz and after end the quiz click on the submit button. After submitting the quiz everyone get a participating certificate on your email id.
Here you can see all the question which are asked in the quiz.
Q.1. Which of these in not a core data type?
A. Lists
B. Dictionary
C. Tuples
D. Class
Q.2. What is the output of following program after executing a(1, 2): def add_numbers(x, y): return x - y a = add_numbers *
A. -1
B. 3
C. 1
D. none of the mentioned
Q.3. What is the maximum possible length of an identifier?
A. 31 characters
B. 63 characters
C. 79 characters
D. none of the mentioned
Q.4. Which of the following is not a keyword?
A. eval
B. assert
C. nonlocal
D. pass
Q.5. The output of the expressions x.append(3.3) where x = [1, 'a', 2, 'b']
A. [1, 'a', 2, 'b', 3.3]
B. ['1', 'a', '2', 'b', '3.3']
C. [1, a, 2, b, 3.3]
D. error
Q.6. what is the output: type(None)
A. function
B. NoneType
C. error
D. none of these
Q.7. Which of the following is the truncation division operator?
A. /
B. %
C. //
D. |
Q.8. What will be the output of the following Python expression if X=345? print(“%06d”%X)
A. 345000
B. 000345
C. 000000345
D. 345000000
Q.9. What will be the output of the following Python code? '%s' %((1.23,),)
A. ‘(1.23,)’
B. 1.23,
C. (,1.23)
D. ‘1.23’
Q.10. What will be the output of the following Python statement? >>>"a"+"bc"
A. a
B. bc
C. bca
D. abc
Q.11. To remove string “hello” from list1, we use which command?
A. list1.remove(“hello”)
B. list1.remove(hello)
C. list1.removeAll(“hello”)
D. list1.removeOne(“hello”)
Q.12. The character Dot (that is, ‘.’) in the default mode, matches any character other than ____________
A. caret
B. ampersand
C. percentage symbol
D. newline
Q.13. The expression a{5} will match ______characters with the previous regular expression.
A. 5 or less
B. exactly 5
C. 5 or more
D. exactly 4
Q.14.. Which of the following functions results in case insensitive matching?
A. re.A
B. re.U
C. re.I
D. re.X
Q.15. _____ represents an entity in the real world with its identity and behaviour
A. A method
B. An object
C. A class
D. An operator
Q.16. ____ is used to create an object
A. class
B. constructor
C. User-defined functions
D. In-built functions
Q.17. What is setattr() used for?
A. To access the attribute of the object
B. To set an attribute
C. To check if an attribute exists or not
D. To delete an attribute
Q.18. Which of the following best describes polymorphism?
A. Ability of a class to derive members of another class as a part of its own definition
B. Means of bundling instance variables and methods in order to restrict access to certain class members
C. Focuses on variables and passing of variables to functions
D. Allows for objects of different types and behaviour to be treated as the same general type
Q.19. What is the use of duck typing?
A. More restriction on the type values that can be passed to a given method
B. No restriction on the type values that can be passed to a given method
C. Less restriction on the type values that can be passed to a given method
D. Makes the program code smaller
Q.20. What is the output of: type(1.0)
A. int
B. float
C. function
D. error
0 Comments