FYBSC SEM 1 PROGRAMMING WITH PHYTHON 1 UNIT 1
MCQ QUESTIONS
1. What does IDLE stand for?
A. Integrated Development and Learning Environment
B. Interactive Data Learning Environment
C. Integrated Data Language Editor
D. Interactive Development Language Environment
Answer: A
A. Integrated Development and Learning Environment
B. Interactive Data Learning Environment
C. Integrated Data Language Editor
D. Interactive Development Language Environment
Answer: A
2. Which symbol represents the Python interactive prompt?
A. >>>
B. ###
C. $$$
D. ///
Answer: A
A. >>>
B. ###
C. $$$
D. ///
Answer: A
3. Which statement is used to assign a value to a variable?
A. assign
B. set
C. =
D. ==
Answer: C
A. assign
B. set
C. =
D. ==
Answer: C
4. What will be the output of the following?
x = 10 x = "Python" print(x)
A. 10
B. Python
C. 10 Python
D. Error
Answer: B
x = 10 x = "Python" print(x)
A. 10
B. Python
C. 10 Python
D. Error
Answer: B
5. Which statement is used to test whether a condition is true?
A. check
B. test
C. assert
D. verify
Answer: C
A. check
B. test
C. assert
D. verify
Answer: C
6. What does the following statement do?
x = None
A. Deletes x
B. Assigns zero to x
C. Assigns the absence of a value to x
D. Generates an error
Answer: C
x = None
A. Deletes x
B. Assigns zero to x
C. Assigns the absence of a value to x
D. Generates an error
Answer: C
7. Which statement is used to delete a variable?
A. remove x
B. delete x
C. del x
D. clear x
Answer: C
A. remove x
B. delete x
C. del x
D. clear x
Answer: C
What is the default return type of the input() function?
A. Integer
B. Float
C. String
D. Boolean
Answer: C
A. Integer
B. Float
C. String
D. Boolean
Answer: C
9. Which function is used to display output on the screen?
A. display()
B. output()
C. show()
D. print()
Answer: D
A. display()
B. output()
C. show()
D. print()
Answer: D
10. Which statement is used to import an already-defined module?
A. include math
B. import math
C. using math
D. load math
Answer: B
A. include math
B. import math
C. using math
D. load math
Answer: B
11. Which of the following is an augmented assignment statement?
A. x =+ 5
B. x ++ 5
C. x += 5
D. x = x +
Answer: C
A. x =+ 5
B. x ++ 5
C. x += 5
D. x = x +
Answer: C
12. Which built-in function provides documentation about Python objects?
A. doc()
B. help()
C. info()
D. manual()
Answer: B
A. doc()
B. help()
C. info()
D. manual()
Answer: B
13. Which keyword is used to define a function?
A. function
B. define
C. def
D. fun
Answer: C
A. function
B. define
C. def
D. fun
Answer: C
14. What is the output?
x = "Python" print(x[0])
A. P
B. y
C. n
D. Python
Answer: A
15. Which of the following is a mutable data type?
A. String
B. Tuple
C. List
D. Integer
Answer: C
x = "Python" print(x[0])
A. P
B. y
C. n
D. Python
Answer: A
15. Which of the following is a mutable data type?
A. String
B. Tuple
C. List
D. Integer
Answer: C
16. Which of the following is an immutable data type?
A. List
B. Dictionary
C. String
D. Set
Answer: C
17. Which brackets are normally used to create a list?
A. ( )
B. [ ]
C. { }
D. < >
Answer: B
A. List
B. Dictionary
C. String
D. Set
Answer: C
17. Which brackets are normally used to create a list?
A. ( )
B. [ ]
C. { }
D. < >
Answer: B
18. What will be the output?
numbers = [10, 5, 20, 2] print(max(numbers))
A. 2
B. 5
C. 10
D. 20
Answer: D
numbers = [10, 5, 20, 2] print(max(numbers))
A. 2
B. 5
C. 10
D. 20
Answer: D
19. What will be the output?
numbers = [10, 20, 30] print(sum(numbers))
A. 30
B. 50
C. 60
D. 600
Answer: C
numbers = [10, 20, 30] print(sum(numbers))
A. 30
B. 50
C. 60
D. 600
Answer: C
20. Which feature of Python is used to execute a block of statements repeatedly?
A. Assignment
B. Loop
C. Import
D. Assertion
A. Assignment
B. Loop
C. Import
D. Assertion
Answer: B