- What is a class?. How to define a class in Python?. How to instantiate a class? How the members are accessed?
- Differentiate class variables and instance variables
- 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.
- Differentiate between simple, multiple and multilevel inheritance
- 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).
- 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.
- 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.
- Explain __init__ and str method with an example python program.
- Define polymorphism. Demonstrate polymorphism with function to find histogram to count the number of times each letter appears in a word and in sentence.
- What is pure function. Write a python program to find duration of event if start and end time is given by defining class Time.
- Write a python program to illustrate the concept of global variable.
Tuesday, April 14, 2020
Python Application Programming - Module 4 - 17CS664, 18CS55
Saturday, April 4, 2020
Python Application Programming - Module 2 - 17CS664, 18CS55
- Explain for and while loop. Write a program to generate fibonacci series up to the given limit by defining fibonacci (n) function.
- Mention the advantage of continue statement. Write a program to compute only sum of even numbers within the natural number using continue statement.
- Define string. Illustrate how it can be traversed using for loop.
- What are string slices. Explain the slicing operator in python with examples.
- Write a python program to display presence of given substring in main string.
- How computational faults or computational errors are handled in python.
- Write a python program to copy all lines beginning with vowels from SAMPLE.txt to VOWEL.txt retaining other lines.
- With syntax, explain finite and infinite looping constructs in python. What is the need for break and continue statements.
- Write a python program to generate and print prime numbers between 2 to 100.
- Write a python program to count the number of occurrences of a given word in a file.
- Write a python program that takes decimal number as input and convert that to binary equivalent and return the same.
- List any five methods associated with strings and explain each of them with an example.
Python Application Programming - Module 1 - 17CS664, 18CS55
- List the key features of Python Programming Language.
- What is the role of a programmer?. List at least two skills required to be a best programmer.
- Differentiate between compiler and interpreter
- Explain Python words and sentences with an example for each.
- What is meant by interactive mode.
- Explain short circuit evaluation of expression with suitable example in python.
- Mention three types of error encountered in python programming language.
- Explain the basic building blocks of python with an example
- Explain the chained and nested conditional execution statements along with syntax and flowchart.
- Write a python program to find the largest of three numbers
- Write a python program to check whether a given year is leap year or not with functions.
- Describe the python language support for arithmetic operators with an example.
- 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.
- 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.
- 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
- Explain the concept/properties of Lists in Python with suitable example and state diagram.
- Explain the concept of mapping in Lists with state diagram.
- What are the different ways of traversing a list. Explain with an example for each.
- Describe any two operations on list with suitable example.
- Illustrate with an example slicing operator on lists.
- Illustrate the usage of list methods with suitable example.
- Write a program in python to illustrate the concept of reduce in Lists
- Write a program in python to illustrate the concept of filter in Lists
- 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.
- 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.
- Differentiate between pop and remove methods on Lists with suitable example.
- Illustrate with an example how to delete more than one element from a list.
- 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.
- Construct a code to convert a string to a List.
- Explain the concept of aliasing in List with suitable example.
- Compare and contrast Lists and Tuples.
- Create a list with nested list elements in it and iterate over them to print each element and subelement of a list.
- Explain the following operations in tuples.
- sum of two tuples
- Slicing operators
- Comparison of two tuples
- Assignments to variables
- List merits of dictionary over list.
- Demonstrate how a dictionary item can be represented as a list of tuples.
- Demonstrate how tuples can be used as keys in a dictionaries.
- Explain extracting data using regular expressions. Implement a python program to find for lines having ‘@‘ character sign between characters in a read text file.
- 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.
- 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.
- Write a program in python to illustrate the power of escape character along with regular expression.
Subscribe to:
Posts (Atom)
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...
-
Module 1 Define IOT. Explain Evolutionary phases of the internet What is IOT? Explain in detail on Genesis of IOT. What does IOT and digi...
-
List the key features of Python Programming Language. What is the role of a programmer?. List at least two skills required to be a best ...
-
What is a class?. How to define a class in Python?. How to instantiate a class? How the members are accessed? Differentiate class varia...