Exam 1: Basic Python Programming
Exam 1: Basic Python Programming51 Questions
Exam 2: An Overview of Collections50 Questions
Exam 3: Searching, Sorting, and Complexity Analysis50 Questions
Exam 4: Arrays and Linked Structures50 Questions
Exam 5: Interfaces, Implementations, and Polymorphism50 Questions
Exam 6: Inheritance and Abstract Classes50 Questions
Exam 7: Stacks50 Questions
Exam 8: Queues50 Questions
Exam 9: Lists50 Questions
Exam 10: Trees50 Questions
Exam 11: Sets and Dictionaries50 Questions
Exam 12: Graphs50 Questions
Select questions type
What is the value of z after the following code is run?
Y = 0
Z = 0
For x in range(5,8):
Z = max(x, y)
Y = y + x
(Multiple Choice)
4.7/5
(47)
A dictionary object contains zero or more entries where each entry associates a unique key with a value.
(True/False)
4.9/5
(36)
What is the output of the following code? sum = 0
Value = 3
While value <= 5:
Sum += value
Value += 1
Print(sum)
(Multiple Choice)
4.9/5
(41)
A tuple is an immutable sequence of items and does not have mutator methods.
(True/False)
4.9/5
(32)
Which of the following correctly defines a function named myFunc?
(Multiple Choice)
4.9/5
(28)
Which comparison operation returns True if variable x is not equal to variable y?
(Multiple Choice)
4.7/5
(39)
What is the name of the function that contains the starting point of program execution?
(Multiple Choice)
4.8/5
(35)
Which of the following statements creates a tuple containing four items?
(Multiple Choice)
4.7/5
(37)
What is the output of the following code?
Sum = 0
For value in range(1,4):
Sum += value
Print(sum)
(Multiple Choice)
4.9/5
(35)
If you print the string "Hello, it is a very \nice day", there will be two lines of output.
(True/False)
4.9/5
(40)
Which statement allows a programmer to run a module as a standalone program or import it from the shell?
(Multiple Choice)
4.9/5
(40)
The while statement uses the syntax while : and is the preferred control statement to iterate over a definite range of sequences.
(True/False)
4.7/5
(39)
What is the last line of output of the following code?
Pres = {1:"Washington", 16:"Lincoln", 35: "Kennedy", 40:"Reagan"}
For nth in pres:
Print("%2d:" % nth,pres[ nth ])
(Multiple Choice)
4.7/5
(44)
What is the last line of the output when the following code is executed?
X = 2
For exp in range (5):
Print ("%2d.0" % x**exp)
(Multiple Choice)
4.8/5
(35)
You can use the slice operator to obtain a substring from a string.
(True/False)
4.8/5
(43)
Showing 21 - 40 of 51
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)