IE6400_HW2
.pdf
keyboard_arrow_up
School
Northeastern University *
*We aren’t endorsed by this school
Course
6400
Subject
Industrial Engineering
Date
Dec 6, 2023
Type
Pages
2
Uploaded by CountToadMaster994
IE6400 Foundations Data Analytics Engineering
Fall Semester 2023
Assignment 2
1.
Create a Python list called grades containing the grades of 50 students in a class (e.g., [87,
92, 78, 95, 88, 72, 98, 84, 91, 89, ...]).
2.
Write a Python program to find and print the highest and lowest grades in the grades list.
3.
Create a passed list containing the index position of students who scored 70 or above in
the grades list.
4.
Write a Python program to calculate and print the average grade in the grades list.
5.
Create a list called grade_bins to categorize the grades into bins: "A" (90-100), "B" (80-
89), "C" (70-79), "D" (60-69), and "F" (below 60). Place each student's grade in the
appropriate bin and print the distribution.
6.
Create two sets, set1 and set2, each containing 100 random integers.
7.
Write a Python program to find and print the intersection of set1 and set2.
8.
Create a set called prime_numbers containing prime numbers between 1 and 500.
9.
Write a Python program to create a new set of cubes containing the cubes of all numbers
in set 1.
10.
Write a Python program to determine if set1 and set2 are disjoint sets (i.e., they have no
elements in common).
11.
Create a list of tuples and students, where each tuple represents a student's name, age, and
GPA. Populate it with data for 50 students.
12.
Write a Python program to find and print the student with the highest GPA in the students'
list.
13.
Create a tuple called course_grades with the following structure: (course_name,
[list_of_grades]). Populate it with grades for at least five courses and calculate each
course's average grade.
14.
Write a Python program to sort the students list based on their ages in ascending order.
15.
Create a dictionary where keys are course names, and values are lists of student names
who took that course using the student's data.
16.
Create a dictionary called employee_data with information about 50 employees, including
name, age, salary, and department (e.g., {"John": (30, 60000, "HR"), "Alice": (28, 75000,
"Engineering"), ...}).
17.
Write a Python program to calculate and print the average salary of employees in each
department.
18.
Create a dictionary called stock_prices with dates as keys and stock prices as values.
Populate it with at least 30 dates and corresponding stock prices.
19.
Write a Python program to create a new dictionary called high_salary_employees that
contains only employees with a salary higher than $70,000.
20.
Write a Python program to merge two dictionaries, dict1, and dict2, where each dictionary
contains data for at least 20 different items, and handle conflicts where both dictionaries
have the same key by choosing the value from dict2.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help