Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 64 pages
Exam (elaborations)

INTRODUCTION TO PYTHON EXAM LATEST EXAM 2025 | ALL QUESTIONS AND CORRECT ANSWERS (VERIFIED ANSWERS) | LATEST EXAM | ALREADY GRADED A+ | JUST RELEASED

Document preview thumbnail
Preview 4 out of 64 pages

INTRODUCTION TO PYTHON EXAM LATEST EXAM 2025 | ALL QUESTIONS AND CORRECT ANSWERS (VERIFIED ANSWERS) | LATEST EXAM | ALREADY GRADED A+ | JUST RELEASED

Content preview

INTRODUCTION TO PYTHON EXAM LATEST EXAM
2025 | ALL QUESTIONS AND CORRECT ANSWERS
(VERIFIED ANSWERS) | LATEST EXAM | ALREADY
GRADED A+ | JUST RELEASED


Which of the following is NOT an example of a function?
A. print
B. int
C. math.sin
D. math.pi ---------CORRECT ANSWER-----------------D. math.pi



Which of the following is an example of a Boolean expression?
A. a = a + b
B. a = 10
C. a += b
D. a % b == 2 ---------CORRECT ANSWER-----------------D. a % b == 2



The keyword True in Python is an example of which of the following?
A. A logical operator.
B. A Boolean.
C. A conditional.
D. An expression. ---------CORRECT ANSWER-----------------B. A Boolean.



What type of data results from the last line of the following code:
a += 10
b += 20
a == b
A. A logical operator.
B. A Boolean.
C. An expression.
D. A conditional. ---------CORRECT ANSWER-----------------B. A Boolean.

,If a recursive function does not have a base case or cannot reach a base
case, what will happen?
A. The function will continue to call itself forever until the program crashes.
B. The function will cause a syntax error in the program and the program
will never run.
C. The function will continue to call itself until a conditional statement is
reached.
D. The function will return a Boolean value after it completes 1000
iterations of the function. ---------CORRECT ANSWER-----------------A. The
function will continue to call itself forever until the program crashes.



In Python the following keywords are examples of what?
and
or
not
A. Logical operators.
B. Boolean operators.
C. Expressions.
D. Conditional statements. ---------CORRECT ANSWER-----------------A.
Logical operators.



The Python keyword elif provides what to a program?
A. Forced program termination
B. Logical operators
C. Branching
D. Boolean values ---------CORRECT ANSWER-----------------C. Branching



Consider the following:
a is true
b is false
c is true

,then which of the following statements is correct?
A. a and b and c is true
B. not b or c is false
C. b and not a is true
D. a and b and c is false ---------CORRECT ANSWER-----------------D. a and
b and c is false



When an if/else block is fully contained within an if/elif/else statement, this
is referred to as ...
A. a chained conditional statement.
B. a compound logical operation.
C. a nested conditional statement.
D. an enhanced Boolean operation. ---------CORRECT ANSWER--------------
---C. a nested conditional statement.



When using the "upper" and "lower" methods of a string, which of the
following is true?
A. Parentheses are not required after the keywords "upper" and "lower".
B. An argument will be required.
C. The methods return a new string but do not change the string on which
they operate.
D. They will invert the cases of existing characters in the string. ---------
CORRECT ANSWER-----------------C. The methods return a new string but
do not change the string on which they operate.



Which is a valid way to traverse the characters in a string?
A. Using a "while" loop with a counter.
B. Using the "in" operator.
C. Using the "range" function.
D. Using string methods. ---------CORRECT ANSWER-----------------A. Using
a "while" loop with a counter.

, In the following string
"This is a test"
What is the character at index 5?
A. i
B. s
C. a space
D. a ---------CORRECT ANSWER-----------------A. i



Which of the following is NOT true of strings in Python?
A. The represent a sequence of characters.
B. The have an index value associated with each character.
C. The value of characters at specific indexes can be reassigned.
D. They can contain zero characters. ---------CORRECT ANSWER------------
-----C. The value of characters at specific indexes can be reassigned.



When comparing two strings using greater than or less than Boolean
expressions, which of the following is true?
A. Strings can only be compared when they are assigned to variables.
B. Lowercase characters are evaluated as coming before uppercase
characters.
C. Strings are evaluated based on their length so longer strings are greater
than smaller strings.
D. Uppercase characters are evaluated as coming before lowercase
characters. ---------CORRECT ANSWER-----------------D. Uppercase
characters are evaluated as coming before lowercase characters.



Which is a valid way to traverse the characters in a string?
A. Using a conditional expression and the "len" function.
B. Using a counter and a conditional expression.
C. Using a "for" loop.
D. Using the "find" method. ---------CORRECT ANSWER-----------------C.
Using a "for" loop.

Document information

Uploaded on
March 10, 2025
Number of pages
64
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$23.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
nevilletadayo
4.6
(323)
Sold
900
Followers
458
Items
3502
Last sold
5 days ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions