You are on page 1of 3

Assignment Questions

Set 1
Q1. Write a program to convert a decimal integer into its base 7 equivalent representation.
Q2. Write a program to record the details of students in a class (e.g., Name, Roll No.,
Percentage, Address, etc.) in a dictionary as follows:
Students = {(Name, Roll No.): (Age, Address, Percentage, etc.), ……………….}
Divide the students in the above dictionary into three groups, “Below Average”, “Average”,
and “Above Average” based on their percentage. Take the range of percentage for each group
as per your choice.
Q3. Distinguish between aliasing and cloning with the help of a suitable program.
Set 2
Q1. Write a program to convert a decimal integer into its base 6 equivalent representation.
Q2. Write a program to record the details of employees in an organization (e.g., Name, ID,
Qualification, Address, etc.) in a dictionary as follows:
Employees = {(Name, ID): (Age, Qualification, Address, etc.), ………………….}
Divide the employees in the above dictionary into different groups based on their qualification
and represent each group using separate dictionary.
Q3. Explain string slicing with the help of a suitable program.
Set 3
Q1. Write a program to convert a decimal integer into its base 5 equivalent representation.
Q2. Write a program to record the details of books in a library (e.g., Book Title, Book ID,
Author(s), etc.) in a dictionary as follows:
Books = {(Book ID, Book Title): (Subject, Author(s), Edition, Publisher, etc.),
……………….}
Arrange the books in a sorted order corresponding to their respective author names.
Q3. Explain for-else in Python through a suitable program.
Set 4
Q1. Write a program to convert a decimal integer into its base 4 equivalent representation.
Q2. Write a program to record the details of laptops available on an online shopping website
(e.g., Brand, Model No. Configurations, Price, Customer Rating, etc.) in a dictionary as
follows:
Laptops = {(Brand, Model No.): (Configurations, Price, Customer Rating, etc.),
……………….}
Using the above dictionary, find out the average customer rating of each laptop brand.
Q3. Differentiate between list and tuple with the help of a suitable example.
Set 5
Q1. Write a program to convert a decimal integer into its base 3 equivalent representation.
Q2. Write a program to record the details of various car models manufactured by different
companies (e.g., Company, Model Name, Features, Price, etc.) in a dictionary as follows:
Cars = {(Company, Model Name): (Features, Price, etc.), ………………….}
Using the above dictionary, find out the average mileage of cars manufactured by each
company.
Q3. Write a program to generate and print the adjacency matrix between the vertices in an
undirected graph.
Set 6
Q1. Write a program that receives an integer (less than or equal to nine digits in length) and
prints out the number in words. For example, if the number input is 12342, then the output
should be Twelve Thousand Three Hundred Forty-Two.
Q2. Write a program that has a dictionary of your friends’ name (as keys) and their birthdays.
Print the items in the dictionary in a sorted order. Prompt user to enter the name and check if it
is present in the dictionary. If the name does not exist, then ask the user to enter DOB. Add the
details in the dictionary.
Q3. Write a function that accepts two positive numbers n and m where m<=n, and returns
numbers between 1 and n that are divisible by m.
Set 7
Q1. Create a python function ‘assign_grade(list)’ which records the marks of ten students from
a list and assign a grade based on the following conditions:
If marks>=90 then grade A
If marks >=80 && <90 then grade B
If marks >65 &&<80 then grade C
If marks>=40 && <=65 then grade D
If marks <40 then grade E
Consider the list of marks of 10 students.
Q2. Develop a function in Python to generate and sum the following series:
X + X*Y + (X*Y)2 + (X*Y)3 +……… + (X*Y)N
Supply X, Y, N as inputs to the function. Do not use any library functions, use loops and
other basic structures.

Q3. Develop following functions in Python:


AddMe() – the purpose of this function is to get country name and its capital from user and
develop a data base to store this country, capital pairs. Use suitable data structure for this
task.
FindMe(input) – the purpose of this function is to take country name as input and return its
capital.
DelMe(input) – the purpose of this function is to delete entry on the basis of input country
name.

You might also like