
July 17, 2026
A Simple Python Script That Measures Academic Habits in a Fun Way
Introduction
This little Python script is a fun way to mix school subjects, grades, and TikTok habits into a simple 'score' that labels someone as smart, average, or lazy. Its not serious science, just a playful way to practise input handling, validation, lists, dictionaries, and conditional logic.
Asking the User About Sixth Form
The script starts by checking whether the user goes to sixth form. This determines whether the program should ask for subjects and grades.
year_group = input("Do you go to sixth form? (y/n) ")
If the user says yes, the script collects three subjects.
s1 = input("Enter your 1st subject: ")
s2 = input("Enter your 2nd subject: ")
s3 = input("Enter your 3rd subject: ")
chosen_subjects = [s1, s2, s3]
Validating Grades
For each subject, the script asks for a grade. It keeps looping until the user enters something valid. This is a simple but effective example of input validation.
while True:
grade = input(f"Enter the grade for {subject}: ").strip()
if grade in ["A*", "A", "B", "C", "D", "E", "U"]:
print(f"{subject}: {grade}")
grades_list.append(grade)
break
else:
print("Invalid grade. Please enter A*, A, B, C, D, E, or U.")
TikTok Usage
Next, the script asks whether the user uses TikTok and how many hours they spend on it daily. This number later affects the final score.
tiktok = input("Do you use tiktok? (y/n) ")
if tiktok == "y":
hrs = int(input("How many hours on average do you spend on tiktok a day? "))
else:
hrs = 0
Converting Grades to Numbers
Grades are mapped to numeric values using a dictionary. This makes it easy to calculate an average.
grades_scoring = {"A*":6, "A":5, "B":4, "C":3, "D":2, "E":1, "U":0}
If the user is in sixth form, the script converts each grade into its numeric score and averages them.
numeric_scores = [grades_scoring[g] for g in grades_list]
avg_grade = sum(numeric_scores) / len(numeric_scores)
Calculating the Final Score
The final score is simply the average grade minus the TikTok hours.
final_score = avg_grade - hrs
This score is then used to classify the user.
if final_score >= 4:
result = "smart"
elif final_score >= 1:
result = "average"
else:
result = "lazy"
Final Output
The script ends by printing the result.
print(f"Based on your grades and TikTok usage, you are: {result}")
85 views
