0% found this document useful (0 votes)
4 views6 pages

Assignment 4

This document is an assignment for the course CST 362 Programming in Python at GOVT MODEL ENGINEERING COLLEGE, detailing tasks related to dictionaries and file handling. It includes a declaration of authorship and various programming exercises such as creating dictionaries, file operations, and data manipulation. The assignment is due on March 29 and requires original work with adherence to academic ethics.

Uploaded by

foralbygames
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views6 pages

Assignment 4

This document is an assignment for the course CST 362 Programming in Python at GOVT MODEL ENGINEERING COLLEGE, detailing tasks related to dictionaries and file handling. It includes a declaration of authorship and various programming exercises such as creating dictionaries, file operations, and data manipulation. The assignment is due on March 29 and requires original work with adherence to academic ethics.

Uploaded by

foralbygames
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

GOVT MODEL ENGINEERING COLLEGE- IHRD

DEPARTMENT OF COMPUTER ENGINEERING

Roll No: 08 Name: ALBY THEKKEDAN

Semester/Class: 6th CS B Academic Year: 202

ASSIGNMENT- 4

Course Code and Name: CST 362 Programming In Python

Due Date Date of Submission Date of Return


29 MARCH Before 10 :00 am

SI. No Topics CO Cognitive Level


mapping
1 Learn dictionary

2 Learn File handling

Declaration and statement of authorship

• This assignment is my original work and no part of it has been copied from any other student’s work or from
any other source except where due acknowledgment is made.
• No part of this assignment has been written for me by any other person except where such collaboration has
been authorized by the faculty concerned and must be clearly acknowledged.
• I give permission to copy the marked work to be retained in the department for NBA requirement.
• I understand plagiarism and obey the academic ethics.
• I understand that academic misconduct is a punishable offence.

Signature of the student:

COs
Addressed Total
Max
Marks
Marks
Obtained

Remarks:

Signature

Faculty: Binu VP
1. Write commands for the following

a. Create an empty dictionary stud


b. Add details of 5 students ( rno,namewith rno as key) from your class students list starting from your roll
number.( consider circular list)
c. Sort and Print the list in the order of rno (Convert dictionary stud into a list)
d. Print the student list in the order of name( use lambda function)
e. Create another dictionary stud1 with rno,name,mark(rno as key)
f. Print the details of the students(rno,name,mark) having highest mark.
g. Read a rno and delete that students details from the dictionary.
h. Print the list of passed students ( mark >=50 assume marks out of 100)

2. Use dictionary comprehension to create a dictionary with numbers (key) and its squares(values).

3. Read a string and find the frequency of occurrence of each character in it. Use dictionary.
4. Create a dictionary with binary equivalent of all hexa decimal digits. Use this dictionary to convert the given
hexadecimal number into binary.

5.Find the frequency of occurrence of words in a sentence. Also print the words with highest freq

6.Find the mod of list of numbers stored in a List (use dictionary)

Files
1.Copy one file to another

2. Copy one file to another after removing blank lines


3.Print the words and length of words in sorted order of words from a file.

4. Read numbers stored in one file and store the sorted numbers in another file after deleting duplicates.

5.List of numbers are stored in a file(num.dat). Create two file Prime ( containing prime numbers) and composite(
containing composite numbers) from the numbers stored in num.dat

6.Find the words having largest frequency from the given file.
7.Create a data file in the following format (r.no, name.m1, m2, m3 marks out of 50) 1|aswith|30|40|50 Write
scripts for the following
a) Print the r.no, name and Tot marks in the descending order of total marks (Rank list)
b) Print the list of passed students (marks >=25 for all three subjects)
c) Print the pass percentage in each subject
d)List of students having 80% or more in all the three subjects

8. Write a Python program to create a text file. Read the contents of the file, encrypt every character in the file with
a distance of 3 and write it to a new file. Eg: yak is encrypted as bdn
9.A text file contains the keyword mec replace all occurrence of the word mec with MEC

10.Copy an image file (jpeg) into another file.

You might also like