Comp150 Python Exam 2009

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Zilch
Z
Zilch
Community Contributor
Quizzes Created: 1 | Total Attempts: 130
| Attempts: 130 | Questions: 60
Please wait...
Question 1 / 60
0 %
0/100
Score 0/100
1. Which of the following statements are true?w - to access random access memory, programs must read and write filesx - random access memory is volatiley - a hard drive is an example of non-volatile memoryz - data on non-volatile storage is stored in named locations called files 

Explanation

Random access memory (RAM) is volatile, meaning that its contents are lost when power is turned off or interrupted. A hard drive is an example of non-volatile memory, as the data stored on it remains even when power is removed. Data on non-volatile storage, such as a hard drive, is stored in named locations called files. Therefore, the statements x, y, and z are all true.

Submit
Please wait...
About This Quiz
Comp150 Python Exam 2009 - Quiz

This Comp150 Python Exam 2009 tests knowledge of Python programming. It covers syntax, basic types, and function calls, assessing the ability to interpret code outputs and understand Python's... see morestructural rules. Suitable for learners seeking to evaluate their Python skills. see less

2. Which of the following Python programs run without producing an error? wimport mathprint pi ximport math
print math.pi yfrom math import *print math.pi zfrom math import piprint pi 

Explanation

not-available-via-ai

Submit
3. In regard to random numbers, which of the following statements are true?xRandom numbers are generated in most computers using a deterministic pseudo-random number generator.  yRandom numbers are generated in most computers with radioactive isotopes.  zGenuine random numbers can be produced by the decay of radioactive iso-topes. 

Explanation

not-available-via-ai

Submit
4.  What is the output of the following code?def sum_elements(numbers):sum = 0for item in numbers:if type(item)==list:for item2 in item:sum += item2return sum print sum_elements([[1,2], 3, [4,5]]) 

Explanation

>>>
12
>>>

Submit
5. A namespace is: 

Explanation

A namespace is a syntactic container which permits the same name to be used in different modules or functions. It helps avoid naming conflicts and allows for better organization of code.

Submit
6. Which of the following statements are true?
  • x  - Using symbolic constants makes code easier to read.
  • y -  Using symbolic constants usually makes programs shorter.
  • z -  Using symbolic constants makes code easier to modify. 

Explanation

Using symbolic constants makes code easier to read. Symbolic constants are named values that are assigned to a constant variable. By using symbolic constants, it becomes easier to understand the purpose and meaning of the values used in the code. It also improves code readability by providing descriptive names rather than using literal values.

Submit
7. What is the output of the following code?fruit = 'banana'fruit = 'orange'print fruit 

Explanation

>>>
orange
>>>

Submit
8. What is the output of the following code?def swap (x, y) :x, y = y, x x = 3y = 4z = 5swap(x,y)swap(y,z)print x, y, z  

Explanation

>>>
3 4 5
>>>

Submit
9. What is the output of the following code?name = 'Alice'age = 10 print 'I am %s and I am %d years old.' % (name, age) 

Explanation

>>>
I am Alice and I am 10 years old.
>>>

Submit
10. What is the meaning of the string format conversion specification' %-5d' % n? 

Explanation

The string format conversion specification '%-5d' % n creates a string that is at most 5 characters wide, is left justified, and contains the number n. The '-' sign indicates left justification, and the '5' specifies the minimum width of the string. Since it is at most 5 characters wide, the string can be less than 5 characters if the number n is smaller.

Submit
11. What is the output of the following code?fruit = 'banana'print fruit[-2] 

Explanation

>>> fruit = 'banana'
>>> print fruit[-2]
n
>>>

Submit
12. Consider the following function definition:def read_value_type(prompt='Enter a value> ', convert=float)val= input(prompt)return convert(val)  Which of the following are valid calls to read_value_type? x val = read_value_type ()  y val read_value_type(prompt='Enter a float> ') zval read_value_type(convert=bool, prompt='Enter a boolean> ') 

Explanation

The function definition allows for two optional parameters: prompt and convert. In the given answer, only the first call to read_value_type, "x", is a valid call because it does not provide any arguments and uses the default values for both prompt and convert. The other calls, "y" and "z", provide arguments for the prompt parameter but do not provide an argument for the convert parameter, which would result in an error.

Submit
13. Which of the following assignment statements are syntactically valid? w   -   my_name = "Brendan" x   -    76trombones = "big parade"y   -    more$ = 10000z   -    my_salary = 10, 000  

Explanation

not-available-via-ai

Submit
14. What is the output of the following code?numbers = [1, 2, 3, 4, 5]for index, value in enumerate(numbers):numbers[index] = value**2print numbers 

Explanation

>>>
[1, 4, 9, 16, 25]
>>>

Submit
15. What is the output of the following code?def change_list(param_list):param_list[0] = "Hello" alist = [1, 2, 3, 4, 5]change_list(alist)print alist 

Explanation

>>>
['Hello', 2, 3, 4, 5]
>>>

Submit
16. Which of the following is not a Python basic type? 

Explanation

The given answer is incorrect. The correct answer is "variable". In Python, "variable" is not a basic type. Instead, it is a placeholder used to store values of different types such as bool, float, and list. The other options mentioned (bool, float, and list) are indeed basic types in Python.

Submit
17. Given the following code:var1 = 10var2 = 5var3 = 7which of the following boolean expressions are True?w   -   (var1<var2) or (var2<var3)x   -   (var2<var3) and (var1<var2)y   -   (var2<var1) and (var1<var2) z   -   ((var1<var2) or (var2<var3)) and ((var1<20) and (var2>5)) 

Explanation

>>>
>>> var1 = 10
>>> var2 = 5
>>> var3 = 7
>>> (var1 True
>>> (var2 False
>>> (var2 False
>>> ((var15))
False
>>>

Submit
18. What is the output of the following code?  x =  'Hello'y = 'there'print  x+y

Explanation

The output of the code is "Hellothere". This is because the code is concatenating the strings stored in the variables x and y using the + operator. The result is the combination of the two strings, resulting in "Hellothere".

Submit
19.  

Explanation

>>> Hello Goodbye >>>

Submit
20. Which of the following boolean expressions are True?w    -   5 == 5 and 5 == 6x   -    5 == 6 or 5 == 5y    -   25%2 == 10%3 z    -   'compl50' == 'easy' 

Explanation

>>>
>>> 5 == 5 and 5 == 6
False
>>> 5 == 6 or 5 == 5
True
>>> 25%2 == 10%3
True
>>> 'compl50' == 'easy'
False
>>>

Submit
21. Given the following code:varl =  Truevar2 =  Falsevar3 =  Truewhich of the following boolean expressions are False?w   -   varl and (var2 or var3) and (not var2)x   -   varl or var2y   -   not (varl or var2)z   -   varl and (var2 or var3) 

Explanation

>>>
>>> varl = True
>>> var2 = False
>>> var3 = True
>>> varl and (var2 or var3) and (not var2)
True
>>> varl or var2
True
>>> not (varl or var2)
False
>>> varl and (var2 or var3)
True
>>>

Submit
22. What is the output of the following code?matrix= [[1,2,3],[4,5,6],[7,8,9]]print matrix[1] 

Explanation

>>>
[4, 5, 6]
>>>

Submit
23. What is the output of the following code?items = (1, 3, 5, 7, 9)items[0] = -1print items[0] 

Explanation

>>>

Traceback (most recent call last):
File "/Users/imac/OneDrive/OneDriveBusiness/COMP150/Previous Exams/Untitled.py", line 2, in
items[0] = -1
TypeError: 'tuple' object does not support item assignment
>>>

Submit
24. What will the variable programs contain in the following code fragment?import globprograms = glob.glob("*.py") 

Explanation

The variable "programs" will contain a list of names of all files ending in '.py' in the current working directory. This is because the "glob.glob" function is used to find all files matching a specific pattern, in this case, '*.py'. The function returns a list of file names that match the pattern, and this list is assigned to the variable "programs".

Submit
25. Which of the following statements are true with respect to the following code frag-ment using Tkinter? root .bind ( 'k', do_something)  
  • x -  The function do-something is bound to the event caused by the user pressing the k key. 
  • y -  The variable do-something is set to 'k' within the root window. 
  • z -  do-something and 'k' are aliases of each other. 

Explanation

The correct answer is x. This is because the code fragment is binding the function do_something to the event caused by the user pressing the k key. This means that whenever the user presses the k key, the function do_something will be executed.

Submit
26. What is the best explanation for the following code (assume x is an int)?x = x + 1 

Explanation

The given code `x = x + 1` does not involve any conditional statements or comparisons. Therefore, it does not return a boolean value like True or False. Instead, it increments the value of the variable `x` by 1. Hence, the answer "This code always returns False" is incorrect. The correct explanation is that the code increments the value of `x` by 1.

Submit
27. In the context of programming, refactoring is: 

Explanation

not-available-via-ai

Submit
28. Which of the following statements are true? ​
  • x - In procedural programming, the focus is on writing functions which operate on data.
  • y - In object-oriented programming, the focus is on the creation of objects which contain both data and functionality together.
  • z - A functional programming style involves writing programs where functions do not cause side-effects. 

Explanation

The correct answer is "x and y". In procedural programming, the focus is on writing functions that operate on data. In object-oriented programming, the focus is on the creation of objects that contain both data and functionality together. Therefore, both statements x and y are true.

Submit
29. What is the output of the following code? def countdown(n):while n>=0:print n,n =  n-1print ncountdown(5)  

Explanation

The code defines a function called countdown that takes an argument n. Inside the function, there is a while loop that continues as long as n is greater than or equal to 0. Inside the loop, it prints the value of n and then subtracts 1 from it. After the loop, it prints the final value of n.

When the countdown function is called with an argument of 5, it will print the numbers 5, 4, 3, 2, 1, and then the final value of n which is 0. Therefore, the output of the code is "1 2 3 4 5 0".

Submit
30. What is the output of the following code? fruit = 'banana'print fruit [2]

Explanation

>>> fruit = 'banana'
>>> print fruit [2]
n
>>>

Submit
31. What is the output of the following code?alist = [1,2,3,4]blist = alistalist[0] = 5print blist [0] 

Explanation

>>>
5
>>>

Submit
32. Which of the following statements are true? 
  • x -  Tuples are more efficient to use than lists.
  • y -  Tuple assignment is an example of poor programming style.
  • z -  Tuples can be used as dictionary keys. 

Explanation

Tuples are more efficient to use than lists because tuples are immutable, meaning they cannot be changed once created. This immutability allows tuples to be accessed and processed faster than lists. Tuple assignment is an example of poor programming style because it can make the code less readable and harder to understand. Tuples can be used as dictionary keys because they are hashable, unlike lists which are mutable and cannot be used as keys in a dictionary. Therefore, the correct answer is x and y.

Submit
33. What is the output of the following code?class Point:def __ init __(self) :self.x = 0self.y = 0 def move(self, dx, dy):self.x += dxself.y += dy def equals(self, p2):return self.x==p2.x and self.y==p2.y p1 = Point()p1.move(2,3)p2 = Point()p2.move(2,3)print p1 == p2, p1.equals(p2) 

Explanation

>>>
False True
>>>

Submit
34. What is the output of the following code?a = set("banana")b = set ("apple")print a & b

Explanation

>>>
set(['a'])
>>>

Submit
35. What is the output of the following code?def collatz_sequence(n):while n != 1:print n,if n%2 == 0: n = n/2else:n = n*3+1 collatz_sequence(5) 

Explanation

The code defines a function called collatz_sequence that takes a number n as input. It then enters a while loop that continues until n is equal to 1. Inside the loop, it prints the current value of n. If n is divisible by 2, it updates n to be n divided by 2. Otherwise, it updates n to be n multiplied by 3 and then added by 1.

When collatz_sequence(5) is called, the output will be 5 16 8 4 2. This is because 5 is not divisible by 2, so it is updated to be 5 multiplied by 3 and then added by 1, resulting in 16. 16 is then divided by 2 to give 8, and so on until n becomes 1.

Submit
36. What is the output of the following code?import copyclass Point:def __ init __ (self):self.x = 0self.y = 0def move(self, dx, dy):self.x += dxself.y += dyclass Rectangle:def __ init __ (self):self.corner = Point()self.width = 100self.height = 100def move(self, dx, dy):self.corner.move(dx,dy) box1 = Rectangle()box2 = copy.copy(box1)box1.move(20,50)print box1.corner.x, box1.corner.y, box2.corner.x, box2.corner.y 

Explanation

>>>
20 50 20 50
>>>

Submit
37. What is the output of the following code?fruit = [ 'b', 'a', 'n' , 'a', 'n' , 'a' ]fruit[0] = 'B'print "_".join(fruit)

Explanation

>>>
B_a_n_a_n_a
>>>

Submit
38. What is the output of the following code?fruit = 'banana'n = 0 for char in fruit:if char==' a':n += 1else:n -= 1print

Explanation

fruit = 'banana'
n = 0
for char in fruit:
if char==' a':
n += 1
else:
n -= 1
print n


>>>
-6
>>>

Submit
39. What is the effect of the following code?from Tkinter import *root = Tk ()gameCanvas = Canvas(root, width=200, height=200)gameCanvas.grid(row=0,column=0)x = 10y = 10dx = 1dy = 1ball gameCanvas.create_oval(x, y, x+10, y+10, fill='blue')i = 1while i<100: x += dxy += dygameCanvas.coords(ball, x, y, x+10, y+10 )i += 1 root . mainloop () 

Explanation

The code provided creates a ball on a canvas and uses a while loop to continuously update the position of the ball. The initial position of the ball is set to (10, 10), and it moves across and down the canvas with a step size of 1 in both the x and y directions. The loop runs for 100 iterations, and each time it updates the position of the ball by adding the step size to the current position. Therefore, the ball slowly moves across and down the canvas until it comes to rest at the position (109, 109).

Submit
40. In regards to unit testing, which of the following statements are true?w - you can't test a function if you don't know what the output should bex - unit testing guarantees the correctness of a functiony - unit testing improves the likelihood that a function is correctz - unit testing solves syntax errors 

Explanation

The correct answer is w and x. This means that in regards to unit testing, it is true that you can't test a function if you don't know what the output should be (w), and unit testing guarantees the correctness of a function (x).

Submit
41. What is the output of the following code?v1 = 'Zebra'v2 = 'aardvark'if v1<v2:print v1, 'comes before', v2else:print v2, 'comes before', v1

Explanation

>>>
Zebra comes before aardvark
>>>

Submit
42. What is the output of the following code?max(3, 1, abs(-11), 7, 16-10) 

Explanation

>>> print max(3, 1, abs(-11), 7, 16-10)
11
>>>

Submit
43. What is the value of the parameter in the call to print_twice in the following code?def print_twice(phrase):print phrase, phrasedef print_four_times(phrase):print_twice(phrase +phrase)print_four_times('there') 

Explanation

def print_twice(phrase):
print phrase, phrase

def print_four_times(phrase):
print_twice(phrase +phrase)

print_twice('there')




>>>
there there
>>>

Submit
44. What is the output of the following code?fruit = 'banana'fruit[0] = 'B'print fruit 

Explanation

>>>

Traceback (most recent call last):
File "/Users/imac/OneDrive/OneDriveBusiness/COMP150/Previous Exams/Untitled.py", line 2, in
fruit[0] = 'B'
TypeError: 'str' object does not support item assignment
>>>

Submit
45. Given the following code in file argv.py:import sysstrings= sys.argv[1:]for index, value in enumerate(strings):strings[index] = float(value) print sum(strings)What is the output of the following program invocation?$ python argv.py 3 4 5 

Explanation

>>>
0
>>> $ python argv.py 3 4 5
SyntaxError: invalid syntax
>>>

Submit
46. Consider the following code:from Tkinter import *def say_hi () :print "hi there"root = Tk ()hello button = Button(root, text="Hello", command=say_hi)hello_button.grid(row=O, column=O) root. mainloop () Which of the following statements are true? xsay_hi is the callback that gets called when the hello_button is pressed. yThe message "hi there" is output to the console when the hello...button is pressed.  zA dialog box with the message "hi there" is popped up when the hello_button is pressed.  

Explanation

The statement "x" is true because the function say_hi is the callback that gets called when the hello_button is pressed. However, the statements "y" and "z" are false. The message "hi there" is not output to the console when the hello_button is pressed (statement "y"), and a dialog box with the message "hi there" is not popped up when the hello_button is pressed (statement "z").

Submit
47. Which of the following code snippets produce the same output regardless of the value of n?xif 0<n:if n<10:print 'n is a positive single digit' yif 0<n and n<10: print 'n is a positive single digit' zif 0 < n < 10:print 'n is a positive single digit' 

Explanation

>>>
>>> n = 99
>>> if 0 print 'n is a positive single digit'


n is a positive single digit
>>> if 0 print 'n is a positive single digit'


>>> if 0 print 'n is a positive single digit'


>>> n = -99
>>> if 0 print 'n is a positive single digit'


>>> if 0 print 'n is a positive single digit'


>>> if 0 print 'n is a positive single digit'


>>>

Submit
48. In regards to programming style, which of the following statements are true?w   -   you should use 4 spaces for indentationx   -   imports should go at the top of the filey   -   variable names should be as short as possiblez   -   you should keep function definitions together 

Explanation

5.6. Programming with style
Readability is very important to programmers, since in practice programs are read and modified far more often than they are written. All the code examples in this book will be consistent with the Python Enhancement Proposal 8 (PEP 8), a style guide developed by the Python community.

We’ll have more to say about style as our programs become more complex, but a few pointers will be helpful already:

use 4 spaces for indentation
imports should go at the top of the file
separate function definitions with two blank lines
keep function definitions together
keep top level statements, including function calls, together at the bottom of the program

Submit
49. Which of the following statements are true? 
  • x -  Persistent changes to a function's parameters are called side effects.
  • y -  Pure functions do not produce side effects.
  • z -  It is good programming practice to use pure functions as much as possible.

Explanation

The given correct answer is "x and y". This means that both statements x and y are true. Statement x states that persistent changes to a function's parameters are called side effects, which is true. Statement y states that pure functions do not produce side effects, which is also true. Therefore, the correct answer is x and y.

Submit
50. What is the output of the following program?a = 5b = aa = 3print a, b 

Explanation

The output of the program is "3 5" because the value of "a" is initially set to 5. Then, the value of "b" is assigned the value of "a", which is 5. Finally, the value of "a" is reassigned to 3. Therefore, when we print the values of "a" and "b", we get "3 5".

Submit
51. In the context of programming, abstraction is: 

Explanation

Abstraction in programming refers to the process of simplifying complex systems by breaking them down into smaller, more manageable parts. It involves hiding unnecessary details and only exposing the essential features. The given answer, "A Python function that converts a value into a variable," aligns with this concept of abstraction. By using a function in Python, one can encapsulate a set of instructions or operations and convert a value into a variable, which can then be used in the program. This abstraction helps in organizing and structuring the code, making it easier to understand and maintain.

Submit
52. Which of the following statements are true?
  • x - Functions defined within a class are called methods of that class.
  • y - Variables of the class type are called globals.
  • z - The power of object-oriented programming is that we need to know the details of their implementation to use variables of a given class. 

Explanation

Functions defined within a class are called methods of that class. Variables of the class type are called globals.

Submit
53. What is the output of the following code?def test_while(n):i = nnum_zeros = 0while i>0:remainder = i%10if remainder ==0:num_zeros = num_zeros+1if num_zeros==3:return Truei = i/10return Falseprint test_while(123456), test_while(1002)  

Explanation

The code defines a function called "test_while" that takes an argument "n". Inside the function, there is a while loop that iterates as long as "i" (initialized as "n") is greater than 0. In each iteration, the remainder of dividing "i" by 10 is calculated and stored in the variable "remainder". If "remainder" is equal to 0, the variable "num_zeros" is incremented by 1. If "num_zeros" becomes equal to 3, the function returns True. After each iteration, "i" is divided by 10. Finally, the code prints the result of calling the "test_while" function with the arguments 123456 and 1002. Since there are no zeros in either number, the output is False False.

Submit
54. Which of the following statements are true in the context of Graphical User Interface (GUI) programming?x -  An event loop typically gets events from the user, processes events and causes windows to be redrawn.y - Callbacks are functions that are called when a GUI event occurs.z - In Tkinter, widgets must be created and placed in the root window to appear on the screen. 

Explanation

In the context of Graphical User Interface (GUI) programming, statement x is true. An event loop is responsible for receiving events from the user, processing those events, and triggering the redrawing of windows.

Submit
55. What is the output of the following code? def encrypt (char, rotation):    return chr((ord(char)+ord(rotation))%127) def decrypt (char, rotation):    return chr((ord(char) -ord(rotation))%127) print decrypt (encrypt ('A', 'B'), 'B'),print encrypt (decrypt ('A', 'B'), 'B')

Explanation

>>>
A A
>>>

Submit
56. What is the output of the following code?def global_variable_func():global gvargvar = "changed"1var = "changed"  gvar =  "not changed"1var = "not changed"global_variable_func()print "gvar has", gvarprint "1var has", 1var 

Explanation

The output of the code is "gvar has not changed" and "1var has not changed" because the global_variable_func() function does not modify the values of the variables gvar and 1var. The function only changes the value of the local variable var. Therefore, when the print statements are executed, the values of gvar and 1var remain the same as before the function call.

Submit
57. What is the output of the following code?def matrix_to_sparse(in_matrix):sparse= {}for row_index,row in enumerate(in_matrix):for col_index,val in enumerate(row):if val != 0: sparse[(row_index,col_index)] = valreturn sparse matrix= [[0,0,1], [0,2,0], [3,0,0]] sparse = matrix_to_sparse(matrix)print sparse[(2,0)], sparse[(1,1)], sparse[(0,2)] 

Explanation

>>>
3 2 1
>>>

Submit
58. What is the output of the following code?fruit = 'banana'print fruit[1:5] 

Explanation

fruit = 'banana'
print fruit[1:5]

>>>
anan
>>>

Submit
59. What is the output of the following code?def count(strng):counts= {}for ch in strng:counts[ch] =  counts.get(ch,0)+1return counts counts= count("Hello, Hello")for ch in "Hello":print counts[ch],print 

Explanation

>>>
2 2 4 4 2
>>>

Submit
60. What is the output of the following code?for number in range(20):if number %2 == 0:print number,print 

Explanation

>>>
0 2 4 6 8 10 12 14 16 18
>>>

Submit
View My Results

Quiz Review Timeline (Updated): Apr 7, 2024 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Apr 07, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • May 25, 2015
    Quiz Created by
    Zilch
Cancel
  • All
    All (60)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which of the following statements are true?w - to access random access...
Which of the following Python programs run without producing an...
In regard to random numbers, which of the following statements are...
 What is the output of the following code?def...
A namespace is: 
Which of the following statements are true?x  - Using symbolic...
What is the output of the following code?fruit = 'banana'fruit...
What is the output of the following code?def swap (x, y) :x, y = y,...
What is the output of the following code?name = 'Alice'age =...
What is the meaning of the string format conversion specification'...
What is the output of the following code?fruit = 'banana'print...
Consider the following function definition:def...
Which of the following assignment statements are syntactically...
What is the output of the following code?numbers = [1, 2, 3, 4, 5]for...
What is the output of the following code?def...
Which of the following is not a Python basic type? 
Given the following code:var1 = 10var2 = 5var3 = 7which of the...
What is the output of the following code?  x = ...
 
Which of the following boolean expressions are True?w    -...
Given the following code:varl =  Truevar2 =  Falsevar3 =...
What is the output of the following code?matrix=...
What is the output of the following code?items = (1, 3, 5, 7,...
What will the variable programs contain in the following code...
Which of the following statements are true with respect to the...
What is the best explanation for the following code (assume x is an...
In the context of programming, refactoring is: 
Which of the following statements are true? ​x - In procedural...
What is the output of the following code? def countdown(n):while...
What is the output of the following code? fruit =...
What is the output of the following code?alist = [1,2,3,4]blist =...
Which of the following statements are true? x -  Tuples are...
What is the output of the following code?class Point:def __ init...
What is the output of the following code?a = set("banana")b...
What is the output of the following code?def collatz_sequence(n):while...
What is the output of the following code?import copyclass Point:def __...
What is the output of the following code?fruit = [ 'b',...
What is the output of the following code?fruit = 'banana'n =...
What is the effect of the following code?from Tkinter import *root =...
In regards to unit testing, which of the following statements are...
What is the output of the following code?v1 = 'Zebra'v2 =...
What is the output of the following code?max(3, 1, abs(-11), 7,...
What is the value of the parameter in the call to print_twice in the...
What is the output of the following code?fruit =...
Given the following code in file argv.py:import sysstrings=...
Consider the following code:from Tkinter import *def say_hi () :print...
Which of the following code snippets produce the same output...
In regards to programming style, which of the following statements are...
Which of the following statements are true? x -  Persistent...
What is the output of the following program?a = 5b = aa = 3print a,...
In the context of programming, abstraction is: 
Which of the following statements are true?x - Functions defined...
What is the output of the following code?def test_while(n):i =...
Which of the following statements are true in the context of Graphical...
What is the output of the following code? def encrypt (char,...
What is the output of the following code?def...
What is the output of the following code?def...
What is the output of the following code?fruit = 'banana'print...
What is the output of the following code?def count(strng):counts=...
What is the output of the following code?for number in range(20):if...
Alert!

Advertisement