CS 1101 PROGRAMMING
FUNDAMENTALS ACTUAL EXAM
QUESTIONS AND CORRECT ANSWERS |
2024-2025
What is Python's response to the command: type(0.123)
a. <class 'float'>
b. <class 'bool'>
c. SyntaxError: invalid syntax
d. <class 'int'>
e. <class 'str'> Correct Answer a. <class 'float'>
Consider the following text from a Python interpreter.
>>> print(2 + 2)
4
What is the text ">>>" called?
a. a function
b. an operator
c. a prompt
d. a statement
e. a value Correct Answer c. a prompt
What does the following text indicate in a Python
interpreter?>>>
,a. A syntax error has occurred.
b. One value is much greater than another.
c. Shift a value to the right.
d. The interpreter is ready for you to enter code.
e. The emoji for "food chain". Correct Answer d. The
interpreter is ready for you to enter code.
Which one of the following Python expressions generates
a syntax error?
a. 8 ^ 2
b. 8 ** 2
c. 8 +- 2
d. 8 += 2
e. 8 -+ 2 Correct Answer d. 8 += 2
Which one of the following Python expressions computes
the total number of seconds in 21 minutes and 21
seconds?
a. 21 + 21
b. 21 + 60
c. "21 minutes" + "21 seconds"
d. 21 * 60 + 21
e. seconds = 21 + "21 minutes" Correct Answer d. 21 * 60
+ 21
Which one of the following Python expressions has the
value 64?
a. 8 ^ 2
,b. 8 ** 2
c. 8 +- 2
d. 8 += 2
e. 8 -+ 2 Correct Answer b. 8 ** 2
Consider the following text from a Python interpreter.
>>> print(2 + 2)
4
What is the text "+" called?
a. a function
b. an operator
c. a prompt
d. a statement
e. a value Correct Answer b. an operator
True or False: Learning to debug can be frustrating, but it
is a valuable skill that is useful for many activities beyond
programming. Correct Answer True
An error that is detected while the program is running is
referred to as:
a. a syntax error
b. an exception
c. a compilation error
d. a semantic error
e. a late error Correct Answer b. an exception
, Which of the following is an invalid Python assignment
statement?
a. a = b = 123
b. '3' = 3
c. x = int("123")
d. y = None
e. z = "hi" * 10 Correct Answer b. '3' = 3
What is the output of the following statements?
pi = float(3.14159)
print (pi)
a. 3
b. 3.0
c. 3.14159
d. 0 Correct Answer c. 3.14159
Programmers generally choose names for their variables
that are meaningful and document what the variable is
used for. Correct Answer True
What output will the following Python statements produce?
>>> print (2*3-1)
a. 6
b. 5
c. 4
d. 3 Correct Answer b. 5
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller TUTORWAC. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $22.99. You're not tied to anything after your purchase.