Python Programming Challenge #5 - Generate Random SAT Scores

Python Tutorial

Delve into the specifics of a programming challenge that involves generating random SAT scores for students, with scores ranging from 200-800 and ending in zero. Learn how to use the random module, loop through lists, and perform mathematical operations to achieve the desired results.

Key Insights

  • The programming challenge involves generating random SAT scores for a list of alphabetized students.
  • Scores should fall within the 200-800 range and must end in a zero.
  • To accomplish this task, the random module needs to be imported.
  • The challenge requires looping through the list of students and generating random scores for both Math and Verbal exams.
  • The scores are achieved by generating a random number between 20-80 and then multiplying it by 10 to ensure it falls within the required range and ends in zero.
  • The total score is computed by adding the generated Math and Verbal scores together.

Modern Web Dev Workflow

  1. Set Up the Project

    create-vite, create-next-app — scaffold with sensible defaults.

  2. Build Components

    Small, reusable, well-typed pieces.

  3. Connect Data

    Fetch from APIs, manage state, handle loading/errors.

  4. Deploy

    Vercel, Netlify, or your cloud of choice.

Play video

Video Transcription

The next programming challenge is number five. Given a list of students, we have alphabetized names. Loop through the list generating pairs of random SAT scores for Math and Verbal. Scores must be in the 200-800 range and must end in a zero. To start, we need to import the random module. The expected output will be:

Python Developer Certificate: Live & Hands-on, In NYC or Online, 0% Financing, 1-on-1 Mentoring, Free Retake, Job Prep. Named a Top Bootcamp by Forbes, Fortune, & Time Out. Noble Desktop. Learn More.

“Student SAT Scores: Aiming Math Score, Verbal Score”. Then, for each student, loop the list and generate a random number between 20 and 80 and multiply it by 10 to get a score in the 200-800 range that ends in a zero. Print the student name, math score, and verbal score. To get the total score, add the math and verbal scores together. That takes care of challenge number five.

Learn more in these courses

How to Learn Python

Master Python with Hands-on Training. Python is a Popular Object-oriented Programming Language Used for Data Science, Machine Learning, and Web Development. 

Yelp Facebook LinkedIn YouTube Twitter Instagram