0% found this document useful (0 votes)
11 views3 pages

Python Multiple-Choice Exam Questions

The document contains a Python multiple-choice exam consisting of 30 questions covering various programming concepts. Topics include variable naming, data types, control flow, functions, and common errors. Each question is followed by multiple-choice answers or expected outputs.

Uploaded by

gavxa1o1
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)
11 views3 pages

Python Multiple-Choice Exam Questions

The document contains a Python multiple-choice exam consisting of 30 questions covering various programming concepts. Topics include variable naming, data types, control flow, functions, and common errors. Each question is followed by multiple-choice answers or expected outputs.

Uploaded by

gavxa1o1
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

Python Multiple-Choice Exam (30

Questions)

1. print("Hello" + "World") →

a) Hello World b) HelloWorld c) "Hello" + "World" d) Error

2. Valid variable name?

a) 2value b) my-name c) first_name d) True

3. input() returns? → str

4. Convert "42" to int → int("42")

5. x=5; print(x==5) → True

6. Correct range? → 13 <= age <= 17

7. Output? → B

8. Error? → Wrong operator (= should be ==)

9. Output? → False

10. range(2,10,3) → 2 5 8

11. Problem? → Infinite loop

12. Break at 3 → 0 1 2
13. Continue at 2 → 0 1 3 4

14. n*2 → 4 8 12

15. fruits[1] → banana

16. append() → Adds to end

17. remove yellow → Error

18. len(["a","b","c"]) → 3

19. Loop list correctly → for item in list: print(item)

20. greet() returns Hello!

21. Error? → Indentation

22. test(4) → 5

23. Scope → 5 then 10

24. Purpose of return → Send value back

25. multiply(3,4) → 12

26. func(2) → 5

27. y = x copy → [1,2,3,4]

28. f(f(4)) → 2
29. Sum evens 1–4 → 6

30. Logic error → List unchanged

You might also like