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

Python Basic MCQ Questions

This document contains a series of multiple-choice questions (MCQs) related to basic Python programming concepts. Each question is followed by four answer options, with the correct answer indicated. Topics covered include file extensions, function definitions, data types, and operators in Python.

Uploaded by

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

Python Basic MCQ Questions

This document contains a series of multiple-choice questions (MCQs) related to basic Python programming concepts. Each question is followed by four answer options, with the correct answer indicated. Topics covered include file extensions, function definitions, data types, and operators in Python.

Uploaded by

Soumya Gundi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Basic Python MCQ Questions with Answers

1. What is the correct file extension for Python files?

a) .pyt

b) .pt

c) .py (Answer)

d) .python

2. Which keyword is used to define a function in Python?

a) def (Answer)

b) func

c) function

d) define

3. What is the output of: print(2 + 3 * 4)?

a) 20

b) 14 (Answer)

c) 24

d) 18

4. Which data type is used to store text in Python?

a) int

b) str (Answer)

c) float

d) bool

5. What does len() function do in Python?

a) Counts numbers

b) Adds values
c) Returns the length (Answer)

d) Loops through items

6. Which of these is a valid variable name in Python?

a) 1name

b) name1 (Answer)

c) @name

d) name-1

7. What is the output of: print("Hello" + "World")?

a) Hello World

b) Hello+World

c) HelloWorld (Answer)

d) Error

8. What is the output of type(10.5)?

a) int

b) float (Answer)

c) str

d) double

9. Which of the following is a loop structure in Python?

a) iterate

b) repeat

c) for (Answer)

d) loop

10. What does the input() function do?

a) Prints text

b) Takes user input (Answer)


c) Exits program

d) Stores data

11. Which symbol is used for comments in Python?

a) //

b) <!--

c) # (Answer)

d) **

12. What will be the output of print(bool(0))?

a) True

b) False (Answer)

c) 0

d) Error

13. Which operator is used for exponentiation (power) in Python?

a) ^

b) ** (Answer)

c) %

d) //

14. What will be the output of: print(9 // 2)?

a) 4.5

b) 5 (Answer)

c) 4

d) 4.0

15. Which of the following is not a Python data type?

a) list

b) set
c) array (Answer)

d) tuple

You might also like