
Instructions:
1. Write the complete assignments and submit on or before 05.10.2018.
2. Don’t send any softcopy. If you submit in softcopy you will awarded with 0 marks.
3. Don’t copy any content from others.
4. No more acceptances of the assignments after the deadline you will be awarded with 0
marks.
Assignments 5
Dictionaries:
1. Write a short note on Dictionary Data Structure? Explain any 5 methods available in Dictionaries with
examples?
2. Write a program that creates a dictionary of cubes of odd numbers in a given range 1-20?
3. Write a Python program to count of the letters from the string and create a dictionary from a string.
4. Write a program that has a dictionary of your friend’s name (as keys) and their birthdays. Print the items in the
dictionary in a sorted order. Prompt the user to enter a 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?
5. Write a program that prints the maximum and minimum value in a dictionary?
Assignment 6
Strings:
1. With the help of example, explain how we can create strings? Write any five important methods available in
strings each with example?
2. Write the differences between mutable and immutable?
3. If str= “Welcome to the RGUKT IIIT Basar Campus and Python Programming” answer the following
questions:
3.a. Write a program to print tenth character of the above string
3.b.Write a program to print reverse string
3.c. Write a program to print words available in the above string?
3.d.Write a program to print all capital letters available in above string?
3.e. Write a program to print length of above string?
3.f. Write a program to convert above string into all capital letters?
3.g.Write a program to print the index of given word of “IIIT”?
4. Write a program to count the occurrences of each word in given sentence?
5. Write a Program to find the number of Vowels, Consonants, Digits and White space in a String?
6. Write a program to take list of strings and print the longest string?
Assignment 7
Functions:
1. What is a function? How can u create a functions explain with example? What are the advantages of functions?
Explain the followings words: parameters, arguments, return, and function call?
2. List out the types of arguments and explain each type with an example?
3. Write a program that finds the greatest of three given numbers using functions?
4. What is user defined functions and pre defined functions? Explain with one example program?
5. Write a program using function that calculates the hypotenuse of a right angled triangle?
6. Write a program to calculate the area, volume of a cuboids’ using default arguments?
7. Write a program to calculate amount. Suppose the customer is a senior citizen is being offered 12 percent
ROI. For all other customers the ROI is 13 percent. (amount = P+SI)
Assignment 8
Recursion and Functional Programming: