Tuesday, April 14, 2020

Python Application Programming - Module 4 - 17CS664, 18CS55

  1. What is a class?. How to define a class in Python?. How to instantiate a class? How the members are accessed?
  2. Differentiate class variables and instance variables
  3. Write a python program that uses date time module within a class, takes a birthday date as input from the user and prints the age and number of days, hours, minutes and seconds until the next birthday.
  4. Differentiate between simple, multiple and multilevel inheritance
  5. Write a python program that has a class Point with attributes as X and Y coordinates. Create two objects of this class and find the midpoint of both these points. Add a method reflex_x to class Point which returns a new point. Which is the reflection of the point about the X- axis.ex: Point(5,10) = refle_x returns point (5,-10).
  6. Write a program that has a class Person, inherit a class student from person which also has a class MarksAttendence. Assume the attributes for person class as USN, Name, DOB,Gender.  Attributes for student class as : Class, Branch,Year , Attributes for MarksAttendence : Marks, Attendance. Create a student S=Student(‘1JS20IS001’,’unknown’,20-20-2000,’M’,90,95) and display the details of the student.
  7. Write a python program to express instances as return values to define a class rectangle with members width, height, corner_x, corner_y and member function: to find centre, area and perimeter of rectangle.
  8. Explain __init__ and str method with an example python program.
  9. Define polymorphism. Demonstrate polymorphism with function to find histogram to count the number of times each letter appears in a word and in sentence.
  10. What is pure function. Write a python program to find duration of event if start and end time is given by defining class Time.
  11. Write a python program to illustrate the concept of global variable.

Saturday, April 4, 2020

Python Application Programming - Module 2 - 17CS664, 18CS55


  1. Explain for and while loop. Write a program to generate fibonacci series up to the given limit by defining fibonacci (n) function.
  2. Mention the advantage of continue statement. Write a program to compute only sum of even numbers within the natural number using continue statement.
  3. Define string. Illustrate how it can be traversed using for loop. 
  4. What are string slices. Explain  the slicing operator in python with examples.
  5. Write a python program to display presence of given substring in main string.
  6. How computational faults or computational errors are handled in python.
  7. Write a python program to copy all lines beginning with vowels from  SAMPLE.txt to VOWEL.txt retaining other lines.
  8. With syntax, explain finite and infinite looping constructs in python. What is the need for break and continue statements.
  9. Write a python program to generate and print prime numbers between 2 to 100.
  10. Write a python program to count the number of occurrences of a given word in a file.
  11. Write a python program that takes decimal number as input and convert that to binary equivalent and return the same.
  12. List any five methods associated with strings and explain each of them with an example.


Python Application Programming - Module 1 - 17CS664, 18CS55


  1. List the key features of Python Programming Language.
  2. What is the role of a programmer?. List at least two skills required to be a best programmer.
  3. Differentiate between compiler and interpreter
  4. Explain Python words and sentences with an example for each.
  5. What is meant by interactive mode.
  6. Explain short circuit evaluation of expression with suitable example in python.
  7. Mention three types of error encountered in python programming language.
  8. Explain the basic building blocks of python with an example
  9. Explain the chained and nested conditional execution statements along with syntax and flowchart.
  10. Write a python program to find the largest of three numbers
  11. Write a python program to check whether a given year is leap year or not with functions.
  12. Describe the python language support for arithmetic operators with an example.
  13. Write a python program to calculate student result based on 2 exam, 1 sport event and 3 activities conducted in a college with weightage of the activity - 20% and sports - 20% for 50 marks.
  14. List and give syntax of all python supported conditional statements along with its usage with an example program to check whether given number is positive or negative or zero.
  15. Differentiate between parameter and argument. Illustrate the flow of execution of a python function with an example program to convert given Celsius to Fahrenheit  temperature.

Wednesday, April 1, 2020

Python Application Programming - Module 3 - 17CS664, 18CS55


  1. Explain the concept/properties of Lists in Python with  suitable example and state diagram.
  2. Explain the concept of mapping in Lists with state diagram.
  3. What are the different ways of traversing a list. Explain with an example for each.
  4. Describe any two operations on list with suitable example.
  5. Illustrate with an example slicing operator on lists.
  6. Illustrate the usage of list methods with suitable example.
  7. Write a program in python  to illustrate the concept of reduce in Lists
  8. Write a program in python  to illustrate the concept of filter in Lists
  9. Write a function called Nested_List_Sum that takes a nested list of integers and add up the elements from all of the nested lists.
  10. Write a function that takes a list of string as argument and convert all element to uppercase and return a new nested list and display.
  11. Differentiate between pop and remove methods on Lists with suitable example.
  12. Illustrate with an example how to delete more than one element from a list.
  13. Write a program to read n numbers from user and store them in a list. Find the sum, avg, max, min values from the List.
  14. Construct a code to convert a string to a List.
  15. Explain the concept of aliasing in List with suitable example.
  16. Compare and contrast Lists and Tuples.
  17. Create a list with nested list elements in it and iterate over them to print each element and subelement of a list.
  18. Explain the following operations in tuples.
    1. sum of two tuples
    2. Slicing operators
    3. Comparison of two tuples
    4. Assignments to variables
  19. List merits of dictionary over list.
  20. Demonstrate how a dictionary item can be represented as a list of tuples.
  21. Demonstrate how tuples can be used as keys in a dictionaries.
  22. Explain extracting data using regular expressions. Implement a python program to find for lines having ‘@‘ character sign between characters in a read text file.
  23. Write a python program using findall() to find the lines with phone numbers (10 digit) and extract one or more phone numbers from each of those lines.
  24. Write a program that searches for a line that starts with ‘1JS’ followed by any non whitespace character comprising of valid USN number and colon followed by a space and any meaningful student name.
  25. Write a program in python to illustrate the power of escape character along with regular expression.


Database Management systems - Module 2

1 a. Explain the entity integrity and referential integrity constraints.   Why is each considered important. Give examples.    b. Discuss eq...