0% found this document useful (0 votes)
2 views27 pages

Csc211 - Computer Programming II (Python)

The document is a quiz on Python programming basics, covering topics such as syntax, data types, functions, and operators. It includes multiple-choice questions with correct answers provided for each question. The content is structured in a way to test knowledge of fundamental Python concepts and features.
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)
2 views27 pages

Csc211 - Computer Programming II (Python)

The document is a quiz on Python programming basics, covering topics such as syntax, data types, functions, and operators. It includes multiple-choice questions with correct answers provided for each question. The content is structured in a way to test knowledge of fundamental Python concepts and features.
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

CSC211 - COMPUTER PROGRAMMING II (PYTHON)


[[Link]]

SECTION A — PYTHON BASICS (1–25)

1. Which of the following is a feature of Python?


A. Low-level language
B. Complex syntax
C. Interpreted language
D. No standard library
Answer: C

2. Which symbol is used to comment a single line in Python?


A. //
B.
C. #
D. /* */
Answer: C

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


A. .pt
B. .pyt
C. .py
D. .python
Answer: C

4. Python is ___ typed.


A. Statically
B. Dynamically
C. Strongly
D. Weakly
Answer: B

5. Who developed Python?


A. James Gosling
B. Guido van Rossum
C. Dennis Ritchie
D. Bjarne Stroustrup
Answer: B
6. Python was first released in which year?
A. 1991
B. 2000
C. 1989
D. 1995
Answer: A

7. Which function displays output in Python?


A. echo()
B. show()
C. print()
D. display()
Answer: C

8. What is the output of: print(type("Hello"))?


A. <class 'char'>
B. <class 'string'>
C. <type 'str'>
D. <class 'str'>
Answer: D

9. Which of these is NOT a valid variable name?


A. student_name
B. _age
C. 2value
D. value2
Answer: C

10. What does indentation represent in Python?


A. Comment
B. Code block
C. New file
D. Keyword
Answer: B

11. Which of the following is not a Python keyword?


A. pass
B. eval
C. raise
D. lambda
Answer: B
12. Python interpreter executes code…
A. In reverse order
B. Line by line
C. As machine code
D. Only compiled code
Answer: B

13. What is the output of: print(10/4)?


A. 2
B. 2.0
C. 2.5
D. 2.25
Answer: C

14. Which operator performs exponentiation?


A. ^^
B. **
C. ^
D. &&
Answer: B

15. Which function converts input into integer?


A. convert()
B. int()
C. integer()
D. parse()
Answer: B

16. What is the result of: True + False?


A. True
B. False
C. 1
D. 0
Answer: C

17. What does // do?


A. Modulus
B. True division
C. Floor division
D. Exponentiation
Answer: C

18. Which statement is used to skip an iteration in a loop?


A. skip
B. continue
C. pass
D. break
Answer: B

19. What does pass do?


A. Stops execution
B. Skips loop
C. Does nothing
D. Jumps to next function
Answer: C

20. Which function returns length?


A. count()
B. length()
C. size()
D. len()
Answer: D

21. What type does the expression "5" + "6" produce?


A. 11
B. Integer
C. String
D. Float
Answer: C

22. What is the output of: print(bool(0))?


A. True
B. False
C. 0
D. None
Answer: B

23. Which function reads input from the user?


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

You might also like