PGCP-BDACMCE (CCE Modules Exam)•20 Questions
Python and R Programming Practice MCQs
Topic Covered in this Question Set
Python Syntax, Types, Input, Operators and Control Flow
Click on an option to check your answer immediately. Full solution & explanation provided for every question.
Interactive Practice Mode
Python and R Programming Free MCQs
Select an option to test your knowledge with real exam questions and instant explanations.
Total20
Correct0
Wrong0
Progress: 0 of 20 answered0% Accuracy
Q5 of 20
What does this code print? ```python x = 5 print(1 < x < 10, 1 < x > 6) ```
Q7 of 20
A program runs age = input("Age: ") and then print(age + 1). The user types 25. What happens?
Q9 of 20
What does this code print? ```python a = [1, 2] b = a b.append(3) print(a, a is b) ```
Q12 of 20
What does this loop print? ```python for n in range(1, 8): if n == 5: break if n % 2 == 0: continue print(n, end=" ") ```
Q13 of 20
What does this code print? ```python for d in [3, 5, 7]: if d % 2 == 0: print("even") break else: print("none") ```
Q14 of 20
While sketching a program, a developer writes if total < 0: but has not yet decided what to do in that case. Which statement keeps the block valid and does nothing?
Q16 of 20
What do these two lines print? ```python print("A", "B", sep="-", end="!") print("C") ```
Q17 of 20
In the lab program that prints factorials with while f < 2_000_000_000 (starting from 0! = 1 and multiplying f by n after each print), which line is printed last?
Q18 of 20
A nested loop compares each of 1,000 customer records with each of 500 product records. How many times does the inner loop body run?
Q19 of 20
What does this code print? ```python marks = 72 if marks >= 40: print("Pass") elif marks >= 60: print("First class") else: print("Fail") ```
Q20 of 20
A cleaning script calls int("3.5") on a value read from a CSV file. What happens?
Need to review the concepts?
Read Free Study Notes →Read Python and R Programming Study Notes
Review complete topic notes, syntax guides, code examples, and summary tables.