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 88 pages
Exam (elaborations)

SNHU IT 140 Introduction to Scripting Final Exam PDF | 180 Solved Questions & Answers (Latest 2026/2027 Python Study Guide)

Document preview thumbnail
Preview 4 out of 88 pages

Ace your Southern New Hampshire University scripting assessment with this instantly downloadable PDF containing 180 comprehensive final exam practice questions and detailed solutions. This ultimate 2026/2027 study guide covers everything from Python syntax basics and data types to intricate control structures, loops, and custom function logic. Review verified, step-by-step code explanations designed to boost your programming comprehension and help you score an A on your IT-140 exam.

Content preview

IT 140 Introduction to Scripting Comprehensive Final Exam
Questions and Detailed Solutions Latest Update 2026/2027 |
Southern New Hampshire University | Downloadable PDF - 180
Questions

This comprehensive final exam covers the core concepts of introductory scripting including variables and data
types, control structures, functions, strings, lists, dictionaries, file handling, exception handling, and basic
algorithmic thinking. The exam emphasizes problem-solving and debugging in Python. It contains 180
multiple-choice questions, each with four distractors and a fully worked rationale that explains why the keyed
answer is correct. Questions are organized into clearly labelled sections that mirror the major content areas of
the course. Targeted learning outcomes include: Analyze and design algorithmic solutions to computational
problems; Implement programs using Python with proper syntax and structure; Debug and test code using best
practices; Apply data structures such as lists, dictionaries, and strings to solve problems. Every item has been
reviewed for clinical accuracy, current guidelines, and clarity so that students can study with confidence and
self-correct as they work through the bank. Use it as a high-yield review immediately before the exam, or as a
structured practice tool during the unit - the rationales double as concise teaching notes. The recommended
writing time is 3 hours, with a passing score of 70%. Aligned with This exam adheres to the academic standards
of Southern New Hampshire University and aligns with typical introductory scripting curricula at accredited US
universities. standards and reflects the question style commonly seen on accredited program examinations.
Students consistently achieving above the cut score on this bank have historically gone on to earn A+ on the

Section 1: General (Questions 1-180)

1 Consider the following Python code snippet. What is the final value
of the variable `result`?

```python
def mystery(x, y):
while x != y:
if x > y:
x=x-y
else:
y=y-x
return x

result = mystery(48, 18)
```

A) 6
B) 18

,C) 30
D) 48
Answer: A
Rationale: The function computes the greatest common divisor (GCD)
of 48 and 18 using the Euclidean algorithm. The GCD is 6. Options B,
C, and D are intermediate values or inputs, not the final result.
2 Which of the following expressions evaluates to `True` in Python?
A) [] == None
B) 0 == False
C) '' == ' '
D) 1 == True and 2 == True
Answer: B
Rationale: In Python, 0 is considered equal to False and 1 is equal to
True. An empty list is not equal to None, an empty string is not equal
to a space, and 2 is not equal to True. Thus, only B is correct.
3 What will be the output of the following code?

```python
s = 'hello world'
print(s[::-1])
```
A) dlrow olleh
B) hello world
C) world hello
D) olleh
Answer: A
Rationale: The slice `[::-1]` reverses the entire string. The reversed
string is 'dlrow olleh'. The other options are incorrect because they do
not represent the full reversal.

,4 Which of the following statements about Python dictionaries is
TRUE?
A) Dictionary keys must be strings.
B) Dictionaries are ordered by default in Python 3.6 and earlier.
C) Dictionary values must be immutable.
D) Dictionary keys must be immutable.
Answer: D
Rationale: In Python, dictionary keys must be of an immutable type,
such as strings, numbers, or tuples. Values can be any type.
Dictionaries maintain insertion order only from Python 3.7 onwards,
not 3.6.
5 Consider the following code:

```python
try:
x = int('abc')
except ValueError:
print('ValueError')
except TypeError:
print('TypeError')
else:
print('No error')
finally:
print('Finally')
```

What is the output?

A) ValueError
Finally
B) TypeError
Finally

, C) No error
Finally
D) ValueError
No error
Finally
Answer: A
Rationale: `int('abc')` raises a ValueError, which is caught by the first
except block. The else block is skipped because an exception
occurred, but the finally block always executes. Thus, the output is
'ValueError' followed by 'Finally'.
6 What is the time complexity of the following function? (Assume n
is the length of list L)

```python
def contains_duplicate(L):
for i in range(len(L)):
for j in range(i+1, len(L)):
if L[i] == L[j]:
return True
return False
```

A) O(n)
B) O(n log n)
C) O(n^2)
D) O(1)
Answer: C
Rationale: The nested loops compare each element with every
subsequent element, leading to about n(n-1)/2 comparisons, which is
O(n^2). The other options underestimate the growth rate.
7 Which of the following Python expressions will NOT raise an
exception?

Document information

Uploaded on
August 24, 2026
Number of pages
88
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$27.79

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.
StudentArchive
3.9
(7)
Sold
35
Followers
1
Items
1353
Last sold
6 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