Thanks to visit codestin.com
Credit goes to www.scribd.com

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

Mcqs Python Set1

The document contains multiple-choice questions (MCQs) related to Python basics for Class XI Informatics Practices. It covers topics such as variable naming, data types, functions, operators, and control flow. An answer key is provided at the end for reference.

Uploaded by

anandisaha2009
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)
14 views4 pages

Mcqs Python Set1

The document contains multiple-choice questions (MCQs) related to Python basics for Class XI Informatics Practices. It covers topics such as variable naming, data types, functions, operators, and control flow. An answer key is provided at the end for reference.

Uploaded by

anandisaha2009
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

MCQs: Python Basics – Class XI Informatics Practices (065)

1. Which of the following is a valid variable name in Python?


a) 1var
b) var_1
c) var-1
d) var 1
2. Which keyword is used to define a function in Python?
a) define
b) def
c) function
d) fun
3. What is the output of print(3 * '7')?
a) 21
b) 777
c) 737
d) Error
4. Which of the following is not a data type in Python?
a) float
b) str
c) bool
d) real
5. Which operator is used for exponentiation in Python?
a) ^
b) **
c) //
d) %%
6. Which function is used to take user input in Python 3?
a) get()
b) input()
c) read()
d) scan()
7. What will type(10.5) return?
a) int
b) float
c) str
d) double
8. What is the output of print(5 // 2)?
a) 2.5
b) 3
c) 2
d) Error
9. Which of the following is used to convert a string to an integer?
a) float()
b) str()
c) int()
d) chr()
10. What will len("Hello") return?
a) 4
b) 5
c) 6
d) Error
11. Which of the following is a correct string declaration in Python?
a) 'Hello'
b) "Hello"
c) '''Hello'''
d) All of the above
12. Which keyword is used for decision making in Python?
a) for
b) while
c) if
d) repeat
13. Which function is used to find the length of a string?
a) size()
b) count()
c) length()
d) len()
14. Which one is a logical operator in Python?
a) &
b) and
c) +
d) %
15. What will be the output of print(10 != 5)?
a) True
b) False
c) 0
d) 1
16. Which symbol is used for comments in Python?
a) //
b) <!-- -->
c) #
d) /* */
17. Which method converts a string to uppercase?
a) upper()
b) uppercase()
c) toUpper()
d) capitalize()
18. Which function returns the largest item from a list?
a) max()
b) largest()
c) high()
d) top()
19. Which function gives the smallest number among arguments?
a) min()
b) low()
c) small()
d) lesser()
20. Which statement is used to repeat a block of code?
a) if
b) while
c) def
d) input
21. Which keyword is used to terminate a loop early?
a) continue
b) stop
c) break
d) quit
22. What is the output of print('3' + '4')?
a) 7
b) 34
c) Error
d) 12
23. Which of the following is a mutable data type?
a) int
b) str
c) list
d) tuple
24. Which of these is an immutable type?
a) list
b) dict
c) tuple
d) set
25. How do you write an empty list in Python?
a) {}
b) ()
c) []
d) empty
26. Which function is used to get the data type of a variable?
a) type()
b) datatype()
c) typeof()
d) check()
27. What is the result of bool(0)?
a) 0
b) False
c) True
d) None
28. Which of the following is a valid Python numeric type?
a) float
b) int
c) complex
d) All of these
29. Which keyword is used to skip the current iteration of a loop?
a) skip
b) continue
c) next
d) pass
30. What will be the output of print(type("10"))?
a) int
b) str
c) float
d) string

Answer Key

1. b
2. b
3. b
4. d
5. b
6. b
7. b
8. c
9. c
10. b
11. d
12. c
13. d
14. b
15. a
16. c
17. a
18. a
19. a
20. b
21. c
22. b
23. c
24. c
25. c
26. a
27. b
28. d
29. b
30. b

You might also like