0% found this document useful (0 votes)
5 views6 pages

Python Programming Basics Quiz

Uploaded by

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

Python Programming Basics Quiz

Uploaded by

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

1.

Introduction and Basics

1. Who designed the Python programming language?

 (a) Dennis Ritchie

 (b) Guido van Rossum

 (c) James Gosling

 (d) Bjarne Stroustrup

2. Which of the following is NOT a valid character in the Python character set,
as per the notes?

 (a) 'a'

 (b) '5'

 (c) '#'

 (d) '@'

 (Note: '#' is a special symbol in practice but its primary role in the notes is
for comments. Among the choices, it's the one least like a standard
character/digit/alphabet for data itself, but if we go strictly by the notes' list,
'#' is not explicitly listed under "Special symbol like..." while '$', '%', '&', '@'
are. However, if the question intends to find a symbol NOT mentioned at
all, all given options are somewhat part of the character set in some
capacity. Selecting (c) as it is primarily a comment indicator.)

3. Which method is used to write a Multiline Statement in Python, as per the


notes?

 (a) Using Parentheses ()

 (b) Using Square Brackets []

 (c) Using the continuation character \


 (d) All of the above

4. A single line comment in Python starts with which symbol?

 (a) $

 (b) /*

 (c) #

 (d) //

2. Identifiers, Variables, and Keywords

5. Which of the following is a Python keyword according to the notes?

 (a) Variable

 (b) String

 (c) class

 (d) Print

6. Which of the following is a valid name for an identifier in Python?

 (a) 3_variable

 (b) my_Var

 (c) if

 (d) my-variable

7. What characteristic applies to Python identifiers?

 (a) They can start with a number.

 (b) They are NOT case sensitive.

 (c) They can contain special characters like @.

 (d) They are case sensitive.


3. Data Types

8. What is a real number with floating-point representation called?

 (a) Integer

 (b) Complex

 (c) Float

 (d) Null

9. Which data type is described as having two built-in values: True or False?

 (a) Sequence

 (b) Null

 (c) String

 (d) Boolean

10. In Python, a List is described as being:

 (a) Immutable and enclosed in circular brackets ()

 (b) Unordered and enclosed in curly braces {}

 (c) Mutable and enclosed in square brackets []

 (d) An ordered sequence of UNICODE characters

11. Which data structure from the list is immutable?

 (a) String

 (b) Lists

 (c) Tuples

 (d) Set

12. Which data structure is a collection of unique elements that is both


mutable and unordered?

 (a) List

 (b) Tuple
 (c) Set

 (d) String

4. Operators and Control Flow

13. Which arithmetic operator is used for Floor Division?

 (a) /

 (b) %

 (c) **

 (d) //

14. The Relational Operator for "Not equal to" is:

 (a) =>

 (b) !=

 (c) ==

 (d) <>

15. The Logical Operator AND returns True only if:

 (a) Either operand is true.

 (b) The operand is False.

 (c) Both operands are true.

 (d) The operand is True.

16. What does the assignment operator += do?

 (a) Compares two values for equality.

 (b) Checks if the first operand is greater than or equal to the second.

 (c) Adds first and then assigns a new value.

 (d) Multiplies first and then assigns a new value.


17. Which type of conversion is also called type casting because the program
does the conversion exclusively by changing the data type?

 (a) Implicit type conversion

 (b) Explicit type conversion

 (c) Automatic conversion

 (d) Lossy conversion

18. Which function is used to take input from the user?

 (a) display()

 (b) output()

 (c) show()

 (d) input()

5. Loops and Modules

19. What is the process of repetition of a set of instructions based on a


criterion called?

 (a) Conditional Statement

 (b) Loop

 (c) Function Call

 (d) Type Conversion

20. Which loop is used to repeat a set of instructions for a fix number of time?

 (a) while loop

 (b) if statement

 (c) for loop

 (d) do-while loop


21. An Array is an ordered collection of values of the same data type that can
be arranged in one or more dimensions. (True/False)

 (a) True

 (b) False

22. What is a Package in Python?

 (a) A single Python file (.py).

 (b) A special function used for input.

 (c) A collection of related Python modules organized within a


directory.

 (d) An open-source web-based application for code and output.

23. Which Python package is specifically mentioned for data visualization?

 (a) NumPy

 (b) Pandas

 (c) Matplotlib

 (d) SciPy

24. Which application is an open-source web-based application where a single


document contains Python code, output, explanations, and charts?

 (a) Anaconda Navigator

 (b) PyCharm

 (c) Jupyter Notebook

 (d) Microsoft Word

You might also like