0% found this document useful (0 votes)
4 views5 pages

Basic Python Questions (MCQ + MSQ + Short Answer)

Uploaded by

dreadnought070
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)
4 views5 pages

Basic Python Questions (MCQ + MSQ + Short Answer)

Uploaded by

dreadnought070
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

Basic Python Questions (MCQ + MSQ +

Short Answer)
Only Questions (Answers are at the end)

Section A: MCQ (Multiple Choice Questions)

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


A. function
B. def
C. define
D. fun

2. Which data type is used to store decimal values?


A. int
B. float
C. str
D. bool

3. What is the output of print(10 // 3)?


A. 3.33
B. 3
C. 4
D. Error

4. Which symbol is used for comments in Python?


A. //
B. #
C. <!-- -->
D. **

5. What will be the output of print(type("10"))?


A. <class 'int'>
B. <class 'float'>
C. <class 'str'>
D. Error
6. What does len("Python") return?
A. 5
B. 6
C. 7
D. Error

7. Which operator is used for exponent (power)?


A. ^
B. **
C. //
D. %

8. What will be the output of print(5 % 2)?


A. 0
B. 1
C. 2
D. 2.5

9. Which one is used to take input from the user?

A. read()
B. get()
C. input()
D. scan()

10. What is the output of:

print(2 + 3 * 2)

A. 10
B. 12
C. 8
D. 7

11. Which of the following is a valid variable name?


A. 2name
B. name-1
C. name_1
D. class
Section B: MSQ (Multiple Select Questions)

1. Which of the following are Python data types? (Select all that apply)
A. int
B. float
C. real
D. list

2. Which of the following are loop statements in Python? (Select all that apply)
A. for
B. while
C. loop
D. repeat

3. Which of the following are immutable in Python? (Select all that apply)

A. list
B. tuple
C. string
D. set

4. Which of these are valid Python data types? (Select all)

A. dict
B. tuple
C. array
D. set

5. Which are comparison operators? (Select all)

A. ==
B. !=
C. =
D. >=

6. Which of the following are used for conditional statements? (Select all)

A. if
B. elif
C. else
D. when

7. Which functions are used for type conversion? (Select all)


A. int()
B. str()
C. float()
D. convert()

Section C: Short Answer Questions

1. What is Python?

2. What is the difference between list and tuple?

3. What is a variable?

4. What is indentation in Python?

5. What does the print() function do?

6. What is the difference between = and ==?

7. What is a for loop? Give a small example.

8. What is the use of break and continue?

9. What is the difference between append() and insert() in a list?

10. What is a dictionary in Python? Give an example.

✅ ANSWER KEY (At Last)


Section A: MCQ Answers

1. B

2. B

3. B

4. B

5. C
6. B

7. B

8. B

9. C

10. C

11. C

Section B: MSQ Answers

1. A, B, D

2. A, B

3. B, C

4. A, B, D

5. A, B, D

6. A, B, C

7. A, B, C

Section C: Short Answer Key (Points)

1. Python is a high-level programming language used for software development,


automation, web, AI, etc.

2. List is mutable (changeable), Tuple is immutable (not changeable).

3. A variable is a name that stores a value in memory.

4. Indentation means spaces at the beginning of a line used to define code blocks in
Python.

5. print() displays output on the screen.

6. = is assignment, == is comparison.

7. A for loop repeats code for a fixed range/sequence.

8. break stops the loop, continue skips the current iteration.

9. append() adds at end, insert() adds at a specific position.

10. A dictionary stores key-value pairs, example: {"name":"AKR", "age":20}

You might also like