Using functions and two lists write a Python program that asks the user to input each students ID number

and a final grade for each student in the class (grades can be from 0 -100). The class has 10 students.
The program should display the each student id and their grade, the highest grade, the lowest grade and the class average.

I assume you know how to do basic I/O and use functions. Is your problem in setting up lists? If so, google is your friend. The following article should help get you started.

https://www.geeksforgeeks.org/python-list/

The W3Schools web site also has excellent documentation and articles, as can be seen at

https://www.w3schools.com/python/python_lists.asp

whenever you have a general question about something, google is always a good place to start. Particularly with programming stuff. You will find that almost always, someone has already done just what you want, or at least part of it.

To solve this problem, it requires knowledge of Python list, function and list comprehension. The below mentioned article are nice place to learn all these:

www.alphacodingskills.com/python/python-lists.php
www.alphacodingskills.com/python/python-functions.php
www.alphacodingskills.com/python/pages/python-list-comprehension.php

Here's a step-by-step solution to your problem:

1. Define two empty lists: `ids` and `grades`.

2. Use a loop to iterate over the range from 1 to 11 (10 students).

3. Inside the loop, prompt the user to enter the ID number for each student using `input()` function, convert it to an integer, and append it to the `ids` list.

4. Similarly, prompt the user to enter the grade for each student, convert it to an integer, and append it to the `grades` list.

5. After the loop ends, find the maximum grade using the `max()` function and assign it to a variable named `highest_grade`.

6. Find the minimum grade using the `min()` function and assign it to a variable named `lowest_grade`.

7. Calculate the class average by summing up all the grades using the `sum()` function and dividing it by the number of students. Assign the result to a variable named `average`.

8. Finally, display the student ID and grade for each student using a loop that iterates over the length of the `ids` list. Within each iteration, access the corresponding ID and grade using indexing.

9. Display the highest grade, lowest grade, and class average using print statements.

Here's the complete code:

```python
ids = []
grades = []

for i in range(1, 11):
student_id = int(input(f"Enter ID number for student {i}: "))
ids.append(student_id)

grade = int(input(f"Enter grade for student {i}: "))
grades.append(grade)

highest_grade = max(grades)
lowest_grade = min(grades)
average = sum(grades) / len(grades)

print("\nStudent ID and Grade:")
for i in range(len(ids)):
print(f"ID: {ids[i]}, Grade: {grades[i]}")

print("\nHighest Grade:", highest_grade)
print("Lowest Grade:", lowest_grade)
print("Class Average:", average)
```

Hope this helps!

Sure! Here's a Python program that fulfills your requirements:

```python
def get_student_grades():
student_ids = []
grades = []

for i in range(10):
student_id = input(f"Enter student ID for student {i+1}: ")
grade = float(input(f"Enter final grade for student {i+1}: "))

student_ids.append(student_id)
grades.append(grade)

return student_ids, grades

def display_student_grades(student_ids, grades):
print("Student Grades:")
for i in range(len(student_ids)):
print(f"Student ID: {student_ids[i]}, Grade: {grades[i]}")

def get_highest_grade(grades):
return max(grades)

def get_lowest_grade(grades):
return min(grades)

def get_class_average(grades):
return sum(grades) / len(grades)

# Main program
student_ids, grades = get_student_grades()
display_student_grades(student_ids, grades)

highest_grade = get_highest_grade(grades)
lowest_grade = get_lowest_grade(grades)
class_average = get_class_average(grades)

print(f"\nHighest Grade: {highest_grade}")
print(f"Lowest Grade: {lowest_grade}")
print(f"Class Average: {class_average}")
```

Explanation:

1. We first define the `get_student_grades` function to prompt the user to input the student IDs and grades for each student. It makes use of two lists, `student_ids` and `grades`, to store the input values.

2. Next, we define the `display_student_grades` function to print out the student IDs and grades in a formatted manner. It iterates through both lists using a for loop and uses string formatting to display the information.

3. We then define three additional functions: `get_highest_grade`, `get_lowest_grade`, and `get_class_average`. These functions take the `grades` list as input and use built-in Python functions (`max`, `min`, and `sum`) to calculate the highest grade, lowest grade, and class average, respectively.

4. Finally, in the main program section, we call the `get_student_grades` function to retrieve the student IDs and grades from the user. Then, we call the `display_student_grades` function to display the inputted data.

5. We calculate the highest grade, lowest grade, and class average using the respective functions and print them out in the desired format.

Note: In the code, I assumed that the grades are input as floating-point numbers. If you want to accept integer grades instead, you can modify the code accordingly.