โ“ ๐ŸŽ๏ธ NumPy Drift: Speeding Through Arrays at Lightning Speed ๐Ÿ

# You must make sure to run all cells in sequence using shift + enter or you might encounter errors
from pykubegrader.initialize import initialize_assignment

responses = initialize_assignment("1_practicequiz_q", "week_3", "practicequiz", assignment_points = 17.0, assignment_tag = 'week3-practicequiz')

# Initialize Otter
import otter
grader = otter.Notebook("1_practicequiz_q.ipynb")

โ“ ๐ŸŽ๏ธ NumPy Drift: Speeding Through Arrays at Lightning Speed ๐Ÿ#

# Run this block of code by pressing Shift + Enter to display the question
from questions._1_practicequiz_q import Question1
Question1().show()
# Run this block of code by pressing Shift + Enter to display the question
from questions._1_practicequiz_q import Question2
Question2().show()

NumPy: Array Creation in the World of Sport Cars#

Instructions:#

You are designing the internal array processing system for a sport carโ€™s telemetry system! Create a NumPy array of integers from 0 to 120, representing speed data in km/h, using NumPyโ€™s built-in np.arange() method. Write a function generate_speed_array() that:

  1. imports numpy using the common alias np.

  2. Uses np.arange() to generate the array, starting from 0 and ending at 120 (inclusive). Save it to the variable array.

...
def generate_speed_array():
    # Create an array from 0 to 120
    ...
    return array
# Example usage
result = generate_speed_array()
print("Generated speed array:", result)
grader.check("sport-car-dynamics")

Submitting Assignment#

Please run the following block of code using shift + enter to submit your assignment, you should see your score.

from pykubegrader.submit.submit_assignment import submit_assignment

submit_assignment("week3-practicequiz", "1_practicequiz_q")