CSCI 6201 Lab 1
Due Sunday, 09/06/2026, by 11:59 PM (ET)
Announcements
-
This lab covers the basic Python programming concepts from the first two weeks of the course.
-
Start early. The goal is to practice the fundamentals and make sure you understand the code you write.
Goals
The goals for this lab are:
-
Practice basic Python variables, input, output, and arithmetic
-
Practice conditionals and loops
-
Practice functions and lists
-
Combine several basic programming concepts in a small program
-
Help the instructor understand your previous CS and programming background
-
Preview the final project and begin thinking about possible datasets
-
Practice explaining and understanding your own code
Grading
-
70% - Programming exercises
-
5% - CS background check
-
10% - Final project preview
-
15% - Mini-presentation and code understanding
1. Variables, Input, and Output
Complete a small Python program that asks the user for basic information and performs a simple calculation.
Your program should:
-
Ask for the user's name
-
Ask for the user's undergraduate major
-
Ask the user to enter two numbers
-
Print the two numbers, their sum, and their average
Starter code:
name = input("Enter your name: ")
major = input("Enter your undergraduate major: ")
number1 = float(input("Enter the first number: "))
number2 = float(input("Enter the second number: "))
# TODO: calculate the sum
# TODO: calculate the average
# TODO: print the results
2. Conditionals and Loops
2.1 Conditionals
Write a program that asks the user to enter an integer.
Use if / elif / else to print whether the number is:
positive
negative
zero
number = int(input("Enter an integer: "))
# TODO: use if / elif / else
# to determine whether the number
# is positive, negative, or zero
2.2 Loops
Write a program that uses a loop to print the numbers from 1 through 10 and then calculates their sum.
total = 0
for i in range(1, 11):
# TODO: print i
# TODO: add i to total
print("Total:", total)
3. Functions and Lists
Use the following list:
numbers = [72, 85, 90, 68, 100]
Complete the following functions:
-
calculate_average() - return the average value in the list
-
find_highest() - return the highest value in the list
-
count_above_80() - return how many values are greater than 80
Starter code:
numbers = [72, 85, 90, 68, 100]
def calculate_average(values):
# TODO
pass
def find_highest(values):
# TODO
pass
def count_above_80(values):
# TODO
pass
print("Average:", calculate_average(numbers))
print("Highest:", find_highest(numbers))
print("Above 80:", count_above_80(numbers))
4. Grade Analyzer
Now combine what you practiced above into one small program.
Write a grade analyzer that stores several grades in a list and reports:
-
the average grade
-
the highest grade
-
the lowest grade
-
a simple overall performance category based on the average:
90 or above: Excellent
80-89: Good
70-79: Satisfactory
below 70: Needs Improvement
Starter code:
grades = [88, 76, 93, 85, 79]
def calculate_average(values):
# TODO
pass
def find_highest(values):
# TODO
pass
def find_lowest(values):
# TODO
pass
def performance_category(average):
# TODO: use if / elif / else
pass
average = calculate_average(grades)
print("Average:", average)
print("Highest:", find_highest(grades))
print("Lowest:", find_lowest(grades))
print("Performance:", performance_category(average))
Run your program with at least two different lists of grades to make sure it works correctly.
5. CS Background Check
In your notes_lab_1_lastname.txt file, briefly answer the following questions. There are no right or wrong answers. This information will help the instructor understand the class background and adjust the course when appropriate.
-
What was your undergraduate major?
-
What previous computer science or programming courses have you taken? For each course, please provide the course name and your letter grade if available.
-
What programming languages have you used before?
-
On a scale from 1 to 5, how confident do you currently feel about programming?
-
What part of programming do you expect will be most challenging for you in this course?
6. Final Project Preview
The final project will give you an opportunity to use Python to explore and analyze a small dataset. For now, you only need to become familiar with some possible datasets.
Review the scikit-learn toy datasets:
In your notes_lab_1_lastname.txt file, rank your top three choices:
-
First choice: dataset name + one sentence explaining why you are interested in it
-
Second choice: dataset name + one sentence explaining why you are interested in it
-
Third choice: dataset name + one sentence explaining why you are interested in it
You are not committing to a final project topic yet. This is only an early preview.
7. Mini-Presentation and Code Understanding
Each student will give a short 2-3 minute individual presentation about Lab 1. Students will be assigned to present during either Week 2 or Week 3.
Choose one programming exercise from Lab 1 and be prepared to briefly:
-
show your code
-
explain what the code does
-
explain how an important part of your code works
Students presenting in Week 2 may present their work in progress. You may continue improving your Lab 1 submission before the Sunday deadline.
The instructor may also ask a short question about your submitted code. For example, you may be asked to:
-
explain a particular line of code
-
predict what part of the program will output
-
make or describe a small change to your code
Generative AI: You may use generative AI tools as a learning aid, but you are responsible for understanding all code that you submit. Do not submit code that you cannot explain. If you cannot explain or answer basic questions about your submitted work, your Lab 1 grade may be reduced.
The goal is not to prevent you from using modern tools. The goal is to make sure that you are learning the programming concepts and can understand the code you work with.
For the same reason, course quizzes and the midterm exam will be completed using paper and pencil.
8. Submission Guide
Submit one file named:
lab_1_lastname.zip
The ZIP file should include:
-
exercise1.py
-
exercise2_conditionals.py
-
exercise2_loops.py
-
exercise3.py
-
exercise4.py
-
notes_lab_1_lastname.txt, containing:
your CS background check answers
your top three final-project dataset choices and reasons
9. Notes
-
Submit your Lab 1 ZIP file through Blackboard.
-
Lab 1 is due Sunday, 09/06/2026, at 11:59 PM (ET).
-
Start early and ask questions if you are unsure about any part of the assignment.
-
Remember: you should be able to understand and explain all code that you submit.