Southern New Hampshire University

IT140: Introduction to Scripting

A guide to SNHU's first scripting course: variables, decisions, loops, functions, file handling and regular expressions.

Updated October 2026 · 5 min read

IT-140 at Southern New Hampshire University teaches the fundamentals of programming through scripting. SNHU says students learn data types, variables, decision statements, loops, functions and file handling.

By developing simple scripts, students learn common scripting constructs including lists, literals and regular expressions, and use them to build useful applications. It is also one of the accepted prerequisites for IT-145. The main hurdle is learning to break a problem into steps a computer can follow.

Course at a Glance

ItemDetails
UniversitySouthern New Hampshire University (SNHU)
CodeIT-140
Credits3
LevelUndergraduate
PrerequisiteNone listed in the catalog entry
Leads toIT-145 accepts IT-140 (or CS-110) as a prerequisite

What IT-140 Covers

TopicWhat it means
Data types and variablesStoring numbers, text and logical values
Decision statementsChoosing a path with if, elif and else
LoopsRepeating actions with for and while
FunctionsReusable named blocks of code
File handlingReading from and writing to files
Lists, literals, regular expressionsCollections, fixed values and text pattern matching

The catalog does not name the scripting language; use whichever your course materials specify.

Key Concepts Explained

Decisions and Loops Together

Most useful scripts combine them: loop over items, decide what to do with each one. Tracing a small example by hand is the best way to check logic.

Example (Python-style): total = 0, then for score in scores: and inside it if score >= 50: total += 1. After the loop, total holds how many scores reached 50. If scores is [40, 55, 70], the answer is 2.

Functions

A function takes inputs (parameters) and gives back a result. Writing one that does a single job, such as converting a temperature, keeps code readable and easy to test.

Regular Expressions

A regular expression describes a text pattern. For example, \d{3}-\d{4} matches three digits, a hyphen and four digits. They are powerful but easy to over-complicate, so test them on sample strings.

Typical Assignments and How to Approach Them

SNHU does not list assessments in the catalog; this is a general guide.

Work typeWhat it testsHow to approach it
Small scriptsSyntax and logicWrite the steps in words, then code
Function exercisesDecompositionOne job per function
File processingInput and outputHandle a missing file gracefully
Code explanationUnderstandingComment why, not just what

A Method for Writing a Script

Beginners often start typing too soon. A short planning routine saves time.

  1. Write what the script should do in one sentence.
  2. List the inputs and the output you expect.
  3. Write the steps in plain words, marking decisions and repeats.
  4. Code one step, run it, then code the next.
  5. Test with an ordinary case, an empty case and a surprising one.

Working with Lists and Files

Lists hold collections of values and files let a script keep data between runs. Together they power many small useful programs.

Example (Python-style): To count lines containing the word "error" in a log, open the file, loop over each line, and add one to a counter when "error" in line.lower() is true. Print the counter at the end. To test, create a small file with three lines, two containing the word, and confirm the script prints 2.

Handle missing files with a try and except block, and close files when finished (the with statement does this automatically). Cases like these are classic checks of whether you understand file handling rather than just copying examples.

Self-Check Questions

QuestionShort answer
What is a variable?A named place that holds a value
When do you use a loop?When the same steps must repeat
Why write functions?To reuse code and keep programs readable
What does a regular expression do?Matches patterns in text
How do you avoid an infinite loop?Make sure something in the loop changes the condition

Worked Example: A Simple Menu Script

A typical beginner task is a script that shows a menu and responds to a choice. Plan the steps: show options, read the choice, decide which action to run, repeat until the user quits.

Use a while loop that continues until the user enters the quit option. Inside it, an if and elif chain calls a function for each choice. If the input is not valid, print a message and show the menu again. Keep each action in its own function so the loop stays short.

Test by entering each valid option, an invalid option and the quit option. Your explanation should describe how the loop ends, since forgetting that step is a common source of programs that never stop.

Where Students Get Stuck

Study Tips for IT-140

How We Help with IT-140

Send the task, your code and any error text. A tutor can explain the concepts, help you debug your own script, or provide a custom solution to a comparable exercise.

GradeEssays is independent of Southern New Hampshire University. Use our work for study and submit your own code under SNHU's academic integrity policy.

Get Your IT-140 Script Working

Share the task and your code. We prepare a commented model and review your own attempt.

Start My IT-140 Help

Free revisions · Full refund if late · Written from scratch for your order

Frequently Asked Questions

How many credits is IT-140?

3.

Is there a prerequisite?

None is listed in the catalog entry.

Which language is used?

The catalog does not name one; follow your course materials.

Does it lead to IT-145?

Yes, IT-145 accepts IT-140 or CS-110 as a prerequisite.

Are regular expressions included?

Yes, with lists and literals.

Can you write my script?

No. We help you understand and debug your own work; you submit your own code.