We will build one Python application via which users can perform
various analytics tasks on data in 2-D table (similar to
Spreadsheet) format which looks like:
Column Name 1 |
Column Name 2 |
Column Name 3 |
Column Name N |
|
… |
… |
… |
… |
… |
In this table, each row represents the data of one object
that we are interested in. Columns, on the other hand, represent
the attributes of these objects. For example, this table could
represent students’ academic records. Each student’s record is
defined with the following column names (as an example):
Since one student could take multiple classes, there might be multiple records in the table for a given student. For this assignment, you will write a script to implement such a table with Python built-in data object types such as list and dictionary etc. The script you write should support the following:
CWID:34726, FirstName:John, ……, Grade=A
Your script will be implemented as follows:
Please make sure that you do the following:
I HOPE ITS HELPFULL TO YOU ...IF YOU HAVE ANY DOUBTS PLS COMMENTS BELOW...I WILL BE THERE TO HELP YOU...PLS RATE THUMBS UP...!! ALL THE BEST ...
ANSWER::-
AS FOR GIVEN DATA....
NOTE ::-
I have implemented an operation to search list of students based on class id, as only that operation was mentioned in the question. Please find the details.
CODE ::- # List of all students all_student_list = [] # Dictionary to hold students with class id as key and its associated value as list of # students. all_student_class_id = {} # Asking user to provide total number of students N = input("Total number of student? ") idx = 1 # Looping N times seeking student details and adding them to list and dictionary accordingly. for i in range(int(N)): print(" Please provide details of student " + str(idx) + " ") ID = input("Please provide student ID: ") first_name = input("Please provide student first name: ") last_name = input("Please provide student last name: ") gender = input("Please provide student gender ('M' or 'F'): ") dob = input("Please provide student date of birth (MM/dd/yyyy): ") class_id = input("Please provide class id of the student: ") class_date = input("Please provide class date (MM/dd/yyyy): ") grade = input("Student grade for the class: ") # Creating a single record (like a row in the spreadsheet) student_detail = {'ID': ID, 'first_name': first_name, 'last_name': last_name, 'gender': gender, 'dob': dob, 'class_id': class_id, 'class_date': class_date, 'grade': grade} # adding this record to the list all_student_list.append(student_detail) # also adding to the list of corresponding class id if class_id not in all_student_class_id: all_student_class_id[class_id] = [] all_student_class_id[class_id].append(student_detail) idx += 1 # To Perform search operation, asking class id to search for all students with this class id search_class_id = input(" Enter class id to be searched for: ") # Getting details fo the student list for this class id lst_students = all_student_class_id[search_class_id] idx = 1 # Looping through the list and printing details of each student. for stud in lst_students: print(" Please find details of student " + str(idx) + " ") print('ID:' + stud['ID']) print('First Name: ' + stud['first_name']) print('Last Name: ' + stud['last_name']) print('Gender: ' + stud['gender']) print('Date of Birth: ' + stud['dob']) print('Class Id: ' + stud['class_id']) print('Class Date: ' + stud['class_date']) print('Grade: ' + stud['grade']) idx += 1
I HOPE YOU UNDERSTAND..
I HOPE ITS HELP FULL TO YOU..PLS RATE THUMBS UP ITS HELPS ME ALOT...!
THANK YOU....!!!
We will build one Python application via which users can perform various analytics tasks on data...
Storing data and adding to data in a dictionary: Experiment with Python dictionaries and their keys() member function that returns a list of a dictionary's keys. You can check if a particular key is in a dictionary by using the in test with the keys list. For example, if our dictionary is MyDict = { 1: 'One', 2: 'Two', 3: 'Three' } Then ( 2 in MyDict.keys() ) evaluates to True, indicating that 2 is a valid key for MyDict....
project-8c Write a class named Employee that has data members for an employee's name, ID_number, salary, and email_address (you must use those names - don't make them private). Write a function named make_employee_dict that takes as parameters a list of names, a list of ID numbers, a list of salaries and a list of email addresses (which are all the same length). The function should take the first value of each list and use them to create an Employee object....
Using Python. 3) Create a single-linked list (StudentList) where the data in the link is an object of type pointer to Student as defined below. Note that you need to store and pass a pointer of type Student so that you do not create duplicate objects. Test your list with the provided program. You will find example code for a single-linked list of integers in Moodle that you can base your solution on. For your find methods, you can either...
A)) (Ransom Note Problem) in python A kidnapper kidnaps you and writes a ransom note. He does not write it by hand to avoid having his hand writing being recognized, so he uses a magazine to create a ransom note. We need to find out, given the ransom string and magazine string, is it possible to create a given ransom note. The kidnapper can use individual characters of words. Here is how your program should work to simulate the ransom...
NOTE: LANGUAGE IS PYTHON CS160 Computer Science Lab 17 Objectives Work with dictionaries Work with functions Work with files Overview This lab will have you store the birthdays for a group of people. This program will store the information with the focus on the date of the month and not on the individual. The point of this program is to be able to see who has a birthday on a given day or to create a table of birthdays, in...
NOTE: LANGUAGE IS PYTHON CS160 Computer Science Lab 17 Objectives Work with dictionaries Work with functions Work with files Overview This lab will have you store the birthdays for a group of people. This program will store the information with the focus on the date of the month and not on the individual. The point of this program is to be able to see who has a birthday on a given day or to create a table of birthdays, in...
Create a Python script file called hw12.py. Add your name at the top as a comment, along with the class name and date. Ex. 1. a. Texting Shortcuts When people are texting, they use shortcuts for faster typing. Consider the following list of shortcuts: For example, the sentence "see you before class" can be written as "c u b4 class". To encode a text using these shortcuts, we need to perform a replace of the text on the left with...
CS 2050 – Programming Project # 1 Due Date: Session 3 (that is, in one week!). Can be resubmitted up to two times until Session 6 if your first version is submitted by session 3. In this project, you create two classes for tracking students. One class is the Student class that holds student data; the other is the GradeItem class that holds data about grades that students earned in various courses. Note: the next three projects build on this...
python 3 question Project Description Electronic gradebooks are used by instructors to store grades on individual assignments and to calculate students’ overall grades. Perhaps your instructor uses gradebook software to keep track of your grades. Some instructors like to calculate grades based on what is sometimes called a “total points” system. This is the simplest way to calculate grades. A student’s grade is the sum of the points earned on all assignments divided by the sum of the points available...
Create a program (Lab9_Act1_Write.py) that will read in data from the keyboard and store it in a file. Your program should prompt the user for the name of the file to use and then request values be entered until the user is done. This data should be written to two files: a text file, user_file_name.txt and a comma separated value file, user_file_name.csv. To help you with decision making, we suggest that you ask the user to input data representing students’...