Application Development Using Python: Dept. of CSE, DSATM 2020-21 1
Application Development Using Python: Dept. of CSE, DSATM 2020-21 1
Module-I
1. Illustrate a program to display different data types using variables and literal constants. (RS)
2. Show how an input and output function is performed in pythonwith an example. (RS)
3. Explain in detail about the various operators in python with suitable examples. (RS)
4. How the area of circle is calculated explain with an example. (RS)
5. Describe a program to calculate student result based on twoexaminations, one sports event and three
activities conducted. Theweightage of the activity = 30%, sports =20%, and examination=50%
(RS)
6. Demonstrate the various expressions in python with suitableexamples. (RS)
7. Write a program to print the digit at ones place and hundredsplace of a number. (RS)
8. Discuss the need and importance of function in python. (RS)
9. Illustrate a program to exchange the value of two variables withtemporary variables. (RS)
10.Analyze the difference between local and global variables. (RS)
11.List the rules to declare variables in python. Demonstrate at least 3 types of variables uses with an
example program. (June/July 2018)(05 Marks)
12.Explain the rules of precedence used in python to evaluate the expression
(June/July 2018) (05 Marks)
13. Write a python program to find the best of two test average marks out of three test’s marks accepted
by the user. (June/July 2018) (06 Marks)
14. How python handles the exceptions? Explain with an example program.
(June/July 2018) (05 Marks)
15.Write a single user defined function named ‘solve’ that returns the remainder and quotient on
division of two numbers accepted by the user. Print the remainder and quotient separately
16.Predict the output and justify your answer: (i) -11%9 (ii) 7.7//7 (iii) (200-70)*10/5
(iv) not ‘False’(v) 5*1**2 (June/July 2018)(05 Marks)
17.Explain the following: i. skills necessary for a programmer ii. Interactive mode. iii. Short circuit
evaluation of an expression. iv Modulus operator. (Dec 2018/Jan 2019)(04 Marks)
18.Mention 3 types of errors encountered in python programs. Explain the basic building block of
python with an example python program to display format number (Fn=22n+1) for a n value
prompted by users. (Dec 2018/Jan 2019)(08 Marks)
19.Describe python language support for arithmetic operators. Write a python programs to calculate
student result based 2 exam, 1 sport event and 3 activities conducted in the college with weightage of
the activity =20% and sports = 20% for 50 marks. (Dec 2018/Jan 2019) (04 Marks)
20.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.
(Dec 2018/Jan 2019)(08 Marks)
21.Differentiate between argument and parameter. Illustrate the flow of execution of a python function
with an example program to convert give Celsius to Fahrenheit temperature.
(Dec 2018/Jan 2019)(08 Marks)
22. Explain the following
i)skills necessary for a programmer
ii)Interactive mode
iii)short circuit evaluation of expression
iv)Modulus operator (Dec 2018/Jan 2019) (04 Marks)
23. List the features of python programming language(at least five)(June/July 2019) (05 Marks)
24. What is the role of programmer? List two skills required to be a programmer.
(June/July 2019) (05 Marks)
25.Explain the chained and nested conditional execution statement along with syntax and chart.
(June/July 2019) (06 Marks)
26. What are python words and sentences? Explain with an example for each.
28. Write python programs to i) Find largest of three numbers ii)check whether the given year is leap
year or not with functions.(June/July 2019) (08 Marks)
Module-II
7. Discuss the usage of The keys(), values(), items(),get(0 and setdefault() Methods in Dictionaries with
example.
8. What module and function can be used to “pretty print” dictionary values? Explain with examples.
9. Write a python program that uses a dictionary that contains other dictionaries.
10. Explain Dictionaries. Demonstrate with python Program. (June/July 2018)(05 Marks)
11. What are the built-in functions that are used in Tuple?
12. Explain what is range() function and how it is used in lists?
13. Write python program to search for lines that start with the word ‘From’ and a character followed by
a two digit number from 00 and 99 followed by ‘:’ Print the number if it is greater than zero. Assume
the input file. (June/July 2018)(06 Marks)
14. Describe any 2 List Operations and List methods. Write a python program to accept ‘n’ numbers
from user, find sum of all even numbers and product of odd numbers entered in the list
(Dec 2018/Jan 2019)(08 Marks)
15. List merits of Dictionaries over the List. Write a python program to accept USN and marks obtained,
find Maximum and Minimum and Students USN who have scored in the range 100-85, 85-75, 75-60
and below 60 marks separately. (Dec 2018/Jan 2019)(08 Marks)
16. Formulate with an example program to find out all the values in the list that are greater than the
specified number.
17. Compare and contrast tuples and lists. Explain the following operations intuples.
i. Sum of two tuples.
ii. Slicing operators.
iii. Comparison of 2 tuples
iv. Assignments to variables (Dec 2018/Jan 2019)(08 Marks)
18. Explain string slicing in python. Show with an example.(June/July 2018) (04 Marks)
19. Write a python program to accept a sentence from the user and display the longest word of that
sentence along with its length (June/July 2018) (06 Marks)
20. List and explain the string manipulation functions supported in python.
(June/July 2018) (06 Marks)
21. Write the python code to display the last six characters of the string ‘Many hay while the sun shines’
to the console. (June/July 2018) (03 Marks)
22. Write a python program to accept a file name from a user:
a) Display the first N-lines of the file
b) Find the frequency of occurrences of the word accepted from the user in the file.
19. If you don’t want to put \n in your string, how can you write a string
with newlines in it? (RS)
Module-III
27. Why are raw strings often used when creating Regex objects?
• 'RoboCop Nakamoto'
but not the following:
• 'satoshi Nakamoto' (where the first name is not capitalized)
• 'Mr. Nakamoto' (where the preceding word has a nonletter character)
• 'Nakamoto' (which has no first name)
• 'Satoshi nakamoto' (where Nakamoto is not capitalized)
51. How would you write a regex that matches a sentence where the first word is either Alice, Bob, or
Carol; the second word is either eats, pets, or throws; the third word is apples, cats, or baseballs;
and the sentence ends with a period? This regex should be case-insensitive. It must match the
following:
• 'Alice eats apples.'
• 'Bob pets cats.'
• 'Carol throws baseballs.'
• 'Alice throws Apples.'
• 'BOB EATS CATS.'
but not the following:
• 'RoboCop eats apples.'
• 'ALICE THROWS FOOTBALLS.'
• 'Carol eats 7 cats.'
1. Formulate with an example program to find out all the values in the list that are greater than the
specified number. (RS)
2. Write a program to find out the square root of two numbers. (RS)
3. Explain the concept of OOP. Give an overview of OOP terminology. (RS)
4. Create Class in Python with an example. (RS)
5. Define function "IsInstance" with example. (RS)
6. Define Class Object and Class book and how to write a method in Class book. (RS)
7. How to retrieve an image over HTTP and also how to retrieve web pages with urllib. (RS)
8. How to read binary files using urllib. (RS)
9. Create a student class and initialize it with name and roll number. Design methods to:
i. Display_to display all information of the students
ii. setAge_to assign age to student.
iii. setMarks_to assign marks to the student. (June/July 2018) (07 Marks)
10. Using datetime module write a program that gets current date and print the day of the week.
(June/July 2018) (04 Marks)
11. What are polymorphic functions? Explain with a snippet code. (June/July 2018)(05 Marks)
12. What does the keyword self in python mean? Explain with an example.
(June/July 2018)(05 Marks)
13. Show using a python code how _init_ method is invoked when an object is initiated. Explain its
working. (June/July 2018) (06 Marks)
14. Explain _str_ method with a python program. (June/July 2018) (05 Marks)
15. How class can be instantiated in python? 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
functions : to find center, area and perimeter of a rectangle. (Dec 2018/Jan 2019)(08 Marks)
16. Explain init and str method with an example python program. (Dec 2018/Jan 2019)(08 Marks)
17. Define polymorphism. Demonstrate polymorphism with function to find histogram to count the
numbers of times each letters appears in a word and a sentence.(Dec 2018/Jan 2019)(08 Marks)
18. What is a pure function? Write a python program to find duration of event if start and end time is
given by defining class TIME. (Dec 2018/Jan 2019)(08 Marks)
Module-V
17. Explain any 2 socket functions. Explain support for parsing HTML using regular expression with an
example program. (Dec 2018/Jan 2019)(08 Marks)
18. Describe a support of security mechanism employed in Internet application with support of API
usage with an example program to get four strings and put in hidden.PY.
(Dec 2018/Jan 2019)(08 Marks)
19. Write a note on XML. Design python program to retrieve a node present in XML tree.
(Dec 2018/Jan 2019)(08 Marks)
20. Brief on Structured query language, with suitable python program explain functions involved in
creation of database table in python. (Dec 2018/Jan 2019) (08 Marks)
21. Demonstrate with the help of python construct i) how to retrieve an image over HTTP.
(June/July 2019) (08 Marks)
22. Compare and contrast the javascript object notation(JSON) and XML.(June/July 2019) (04 Marks)
23. What is service oriented architecture? List the advantages of the same. (June/July 2019) (04 Marks)
24. Write a python program that retrieve an users twitter friends. Parse the returned JSON and extract
some of the information about the friends. (June/July 2019) (08 Marks)
25. Create a simple spidering program that will go through twitter accounts and build a database of
them. (June/July 2019) (04 Marks)