0% found this document useful (0 votes)
56 views10 pages

CS1101-Graded Quiz Unit 3 - Attempt Review

The document details a quiz taken on Python programming concepts, completed in 17 minutes and 6 seconds, with a score of 16.71 out of 20. It includes questions on debugging, syntax errors, operators, and function parameters, with a mix of correct, incorrect, and partially correct answers. The overall performance indicates a strong understanding of the material, despite a few mistakes.

Uploaded by

chifamba
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)
56 views10 pages

CS1101-Graded Quiz Unit 3 - Attempt Review

The document details a quiz taken on Python programming concepts, completed in 17 minutes and 6 seconds, with a score of 16.71 out of 20. It includes questions on debugging, syntax errors, operators, and function parameters, with a mix of correct, incorrect, and partially correct answers. The overall performance indicates a strong understanding of the material, despite a few mistakes.

Uploaded by

chifamba
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
You are on page 1/ 10

Started on Sunday, 16 February 2025, 3:00 PM

State Finished
Completed on Sunday, 16 February 2025, 3:17 PM
Time taken 17 mins 6 secs
Marks 16.71/20.00
Grade 83.57 out of 100.00

Question 1
Incorrect
Mark 0.00 out of 1.00

Using keywords for variable names will result in a ________________

Select one:
a. runtime error
b. compile error 
c. syntax error
d. semantic error

The correct answer is: syntax error

Question 2
Correct
Mark 1.00 out of 1.00

Learning to debug can be frustrating, but it is a valuable skill that is useful for many activities beyond programming.

Select one:
True 
False

The correct answer is 'True'.


Question 3
Correct
Mark 1.00 out of 1.00

What output will the following Python statement produce?

>>> print (2*3-1)

Select one:
a. 6
b. 5 
c. 4
d. 3

The correct answer is: 5

Question 4
Correct
Mark 1.00 out of 1.00

Which one of the following Python expressions generates a syntax error?

Select one:
a. 2 ^ 2
b. 2 ** 2
c. 2 +- 2
d. 2 += 2 
e. 2 -+ 2

Your answer is correct.


The correct answer is: 2 += 2
Question 5
Correct
Mark 1.00 out of 1.00

What output will the following Python statement produce?

>>> print (2 * (3-1))

Select one:
a. 6
b. 5
c. 4 
d. 3

The correct answer is: 4

Question 6
Correct
Mark 1.00 out of 1.00

Consider the following text from a Python interpreter.


>>> print(2 + 2)
4
What is the text "+" called?

Select one:
a. a function
b. an operator 
c. a prompt
d. a statement
e. a value

Your answer is correct.


The correct answer is: an operator
Question 7
Correct
Mark 1.00 out of 1.00

What is the output of the following Python statements?


def recurse(a):
if (a == 1):
print(a)
else:
recurse(a)
recurse(1)

Select one:
a. 0
b. 1 
c. no output
d. RuntimeError: maximum recursion depth exceeded

Your answer is correct.


The correct answer is: 1

Question 8
Correct
Mark 1.00 out of 1.00

What output will the following Python 3 statement produce?

>>> print (1,000,000)

Select one:
a. 1.0
b. 1,000,000
c. 1 0 0 
d. Error invalid type

The correct answer is: 1 0 0


Question 9
Correct
Mark 1.00 out of 1.00

A program is a sequence of instructions that specifies how to perform a computation.

Select one:
True 
False

The correct answer is 'True'.

Question 10
Correct
Mark 1.00 out of 1.00

What is the output of the following Python statements?


percentage = ( 60 * 100) // 55
print (percentage)

Select one:
a. percentage
b. 109 
c. 109.0909090909091
d. 109.0

Your answer is correct.


The correct answer is: 109
Question 11
Partially correct
Mark 0.71 out of 1.00

Match concepts with their definition!

To join two operands end-to-end. concatenate 

What the Python interpreter does to an expression to find its value. evaluate 

A combination of variables, operators, and values that represents a single result value. statement 

A reserved word that is used by the interpreter to parse programs. keyword 

A special symbol that represents a simple computation like addition, multiplication, or string concatenation. operator 

A unit of code that the Python interpreter can execute. expression 

A name that refers to a value. variable 

The correct answer is: To join two operands end-to-end. → concatenate, What the Python interpreter does to an expression to find its
value. → evaluate, A combination of variables, operators, and values that represents a single result value. → expression, A reserved
word that is used by the interpreter to parse programs. → keyword, A special symbol that represents a simple computation like
addition, multiplication, or string concatenation. → operator, A unit of code that the Python interpreter can execute. → statement, A
name that refers to a value. → variable

Question 12
Correct
Mark 1.00 out of 1.00

When defining a Python function that has no parameters, the parentheses that follow the function’s name are optional.

Select one:
True
False 

The correct answer is 'False'.


Question 13
Correct
Mark 1.00 out of 1.00

When a Python function is called, inside the function, the arguments are assigned to variables called parameters.

Select one:
True 
False

The correct answer is 'True'.

Question 14
Correct
Mark 1.00 out of 1.00

If you assign the result of calling a void function to a variable in Python, you get:

Select one:
a. an empty string
b. the value -1
c. the value 0
d. the special value None 
e. an exception

Your answer is correct.


The correct answer is: the special value None
Question 15
Correct
Mark 1.00 out of 1.00

What output will the following Python statements produce?

>>> percentage = ( 60.0 * 100.0) / 55.0


>>> print (percentage)

Select one:
a. percentage
b. 109
c. 109.0909090909091 
d. 109.0

The correct answer is: 109.0909090909091

Question 16
Correct
Mark 1.00 out of 1.00

What is the output of the following Python 3 statements?


x=2
y=1
if x == y:
print (x, "and", y, "are equal")
else:
if x < y:
print (x, "is less than", y)
else:
print (x, "is greater than", y)

Select one:
a. 1 and 2 are equal
b. 1 is less than 2
c. 1 is greater than 2
d. 2 is greater than 1 

Your answer is correct.


The correct answer is: 2 is greater than 1
Question 17
Correct
Mark 1.00 out of 1.00

Consider the following text from a Python interpreter.


>>> print(2 + 2)
4
What is the text "print" called?

Select one:
a. a function 
b. an operator
c. a prompt
d. a statement
e. a value

Your answer is correct.


The correct answer is: a function

Question 18
Incorrect
Mark 0.00 out of 1.00

In Python, the expression "a**(b**c)" is the same as "(a**b)**c".

Select one:
True 
False

The correct answer is 'False'.


Question 19
Incorrect
Mark 0.00 out of 1.00

What output will the following Python statement produce?

>>> print ((1+1)**(5-2))

Select one:
a. 16 
b. 8
c. 4
d. 2

The correct answer is: 8

Question 20
Correct
Mark 1.00 out of 1.00

What do we call the value provided to a function when the function is called (which is assigned to the corresponding parameter in the
function)?

Select one:
a. argument 
b. return value
c. method
d. the special value None
e. global variable

Your answer is correct.


The correct answer is: argument

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy