Quizs Question

Learn and Test Your Knowledge – A Dive Deep into Trivia, GK (General Knowledge), Current Affairs, General Studies, Programming Language, Fun Quizzes, etc. Expand Your Mind!

Python

Q 1. Who developed Python Programming Language?
A. Guido van Rossum
B. Rasmus Lerdorf
C. Wick van Rossum
D. Niene Stom

Show Answer Answer:-A. Guido van Rossum
Explanation Python language is designed by a Dutch programmer Guido van Rossum in the Netherlands.

Q 2. Which type of Programming does Python support?
A. functional programming
B. object-oriented programming
C. structured programming
D. all of the mentioned

Show Answer Answer:- D. all of the mentioned
Explanation Python is an interpreted programming language, which supports object-oriented, structured, and functional programming.

Q 3. Is Python case sensitive when dealing with identifiers?
A. no
B. yes
C. machine dependent
D. none of the mentioned

Show Answer Answer:- B. yes
Explanation Case is always significant while dealing with identifiers in python.

Q 4. Which of the following is the correct extension of the Python file?
A. py
B. pl
C. python
D. p

Show Answer Answer:-A. py
Explanation ‘.py’ is the correct extension of the Python file. Python programs can be written in any text editor. To save these programs we need to save in files with file extension ‘.py’.

Q 5. Is Python code compiled or interpreted?
A. Python code is only compiled
B. Python code is neither compiled nor interpreted
C. Python code is both compiled and interpreted
D. Python code is only interpreted

Show Answer Answer:-C. Python code is both compiled and interpreted
Explanation Many languages have been implemented using both compilers and interpreters, including C, Pascal, and Python.

Q 6. Which of the following is used to define a block of code in Python language?
A. Key
B. Indentation
C. Brackets
D. All of the mentioned

Show Answer Answer:-B. Indentation
Explanation In Python, to define a block of code we use indentation. Indentation refers to whitespaces at the beginning of the line.

Q 7. Which keyword is used for function in Python language?
A. Function
B. def
C. Fun
D. Define

Show Answer Answer:-B. def
Explanation The def keyword is used to create, (or define) a function in python.

Q 8. Which of the following character is used to give single-line comments in Python?
A. //
B. #
C. !
D. /*

Show Answer Answer:-B. #
Explanation To write single-line comments in Python use the Hash character (#) at the beginning of the line. It is also called number sign or pound sign. To write multi-line comments, close the text between triple quotes. Example: “”” comment text “””

Q 9. Which of the following functions can help us to find the version of python that we are currently working on?
A. sys.version(1)
B. sys.version(0)
C. sys.version
D. sys.version()

Show Answer Answer:- C. sys.version
Explanation The function sys.version can help us to find the version of python that we are currently working on. It also contains information on the build number and compiler used. For example, 3.5.2, 2.7.3 etc. this function also returns the current date, time, bits etc along with the version.

Q 10. Python supports the creation of anonymous functions at runtime, using a construct called __________
A. pi
B. anonymous
C. lambda
D. none of the mentioned

Show Answer Answer:- C. lambda
Explanation Python supports the creation of anonymous functions (i.e. functions that are not bound to a name) at runtime, using a construct called lambda. Lambda functions are restricted to a single expression. They can be used wherever normal functions can be used.

Q 11. What is the order of precedence in python?
A. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction
B. Exponential, Parentheses, Division, Multiplication, Addition, Subtraction
C. Parentheses, Exponential, Multiplication, Division, Subtraction, Addition
D. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction

Show Answer Answer:-D. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
Explanation For order of precedence, just remember this PEMDAS (similar to BODMAS).

Q 12. What does pip stand for python?
A. Pip Installs Python
B. Pip Installs Packages
C. Preferred Installer Program
D. All of the mentioned

Show Answer Answer:- C. Preferred Installer Program
Explanation pip is a package manager for python. Which is also called Preferred Installer Program.

Q 13. Which of the following is true for variable names in Python?
A. unlimited length
B. underscore and ampersand are the only two special characters allowed
C. all private members must have leading and trailing underscores
D. none of the mentioned

Show Answer Answer:-A. unlimited length
Explanation Variable names can be of any length.

Leave a Reply

Your email address will not be published. Required fields are marked *

You cannot copy content of this page