S. G. Balekundri Institute of Technology: Examination Section Department of Compuuter Science and Engineering
This document contains a question bank for a Python Application Programming course with 40 multiple choice questions divided into 4 modules. The questions assess students' understanding of Python programming concepts like data types, conditional statements, loops, functions, file handling, object-oriented programming etc. Each question is accompanied by its marks, cognitive level and expected difficulty level. Sample code snippets are provided for many questions to demonstrate the concept being tested.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
157 views
S. G. Balekundri Institute of Technology: Examination Section Department of Compuuter Science and Engineering
This document contains a question bank for a Python Application Programming course with 40 multiple choice questions divided into 4 modules. The questions assess students' understanding of Python programming concepts like data types, conditional statements, loops, functions, file handling, object-oriented programming etc. Each question is accompanied by its marks, cognitive level and expected difficulty level. Sample code snippets are provided for many questions to demonstrate the concept being tested.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
S. S.
Education Trust’s CET Code: E-175 (UG)/T-942 (PG)
S. G. BALEKUNDRI INSTITUTE OF TECHNOLOGY
Shivabasavanagar, Belagavi- 590 010, Karnataka- India Office: 0831-2407172, 2554559 Fax: 0831-2407152Website: www.sgbit.edu.in Examination Section Form No.: SGBIT/EXAM/65 Email: exam@sgbit.edu.in, Department Extension: 587 Revision R0w.e.f01/04/2020
Department of Compuuter Science and Engineering
QUESTION BANK(CBCS FORMAT) Course Code: 17CS664 Course: Python Application Programming Max.Marks Semester : VI Course Coordinator: Ms. Kangana W. M. Date: 06/02/2020 Module 1 Q. Questions MARK CO RBT NO. S 1. Describe the hardware architecture of a computer. 01 L2 6 What is the role of programmer? List and explain skills L2 2. 01 6 required to be programmer 3. Differentiate complier and interpreter. 01 L2 5 Write a python program to i) Find largest of three numbers ii) L2 4. 01 6 Convert the temperature to Fahrenheit What are the errors that can be detected by python and give L2 5. 01 6 one example to each and explain it. Explain building blocks of programs. State the need for L2 6. 01 6 functions in python. Explain Syntax errors and Logic errors. Write a program which L2 prompts the user for a Celsius temperature, convert the 7. 01 5 temperature to Fahrenheit and print out the converted temperature. Write a short note on : i) ** and ?? operators ii) Short-circuit L2 8. 01 6 evaluation iii) precedence of operators. List and give syntax of all python supported conditional L2 9. statements along with its usage with an example program to 01 8 check whether given number is positive or negative or zero. Explain the chained and nested conditional execution L2 10. 01 6 statement along with syntax and flow chart. Module 2 Explain while loop and for loop. Write a program to generate L2 11. Fibonacci series up to the given limit by defining fibo(n) 02 6 function. What are strings? Explain the strings in python are immutable 02 L2 12. 5 with example. Define slicing. Consider the following code that stores a 02 L2 string:Str = ‘the programming# 1.567 python.com @sgbit.in’ 13. Use find and string slicing to extract the portion of string after 5 # to next space and then use the float function to convert the extracted string into a floating point number. Write a python program to read a number, and find reverse of 02 L2 14. it. Check weather a number is palindrome or not with suitable 5 example. Write a python program to check whether a given number is 02 L2 15. 5 leap year or not with function. Write a python program to i) Find sum of odd numbers ii) 02 L2 16. 6 Generate and print the prime number between 2 to 10. 17. Explain open()and read()function with syntax and example. 02 L2 6 Write a program to search and count and print all the lines 18. starting with a specific word with total count (taken as 02 L2 5 keyboard input) in a file. Write a program to extract string from a file where the string should start with only uppercase letters and should end with a 19. 02 L2 5 digit, and must contain a special character ^, anywhere in- between. Write a program to count number of lines in a file and to 20. 02 L2 5 display the line and total count Module 3 What are the different ways of deleting elements from a list? L2 21. 03 5 Discuss with suitable functions and examples. Define a dictionary type in Python. Give example. Discuss any 03 L2 22. 5 meta characters used in regular expressions with suitable 6 example. 23. List and explain the methods that operates on the list . 03 L2 6 Write the differences between 03 L2 24. a) sort() and sorted() b) append() and extend() c) 6 join() and split() Compare and contrast tuples with Lists. Explain the following 03 L2 operation in tuples i) Sum of two tuples 25. 6 ii) Slicing operators iii) Comparison of two tuples iv) Assignment to variables. Write a python program to read first name, last name and age, 03 L2 26. create a dictionary based on name as key and age as value. 6
Write a program to validate USN (both UG and PG) of VTU 03 L2
27. students. (Hint: UG USN format: 1RN15CS001, PG USN 6 format: 1RN15CSE01) 28. Explain different ways of slicing with example. 03 L2 5 Write a python program to accept ‘n’ number from user. Find 03 L2 29. sum of all even numbers and product of all odd numbers in 5 entered list. 30. Discuss search() and findall() functions of re module 03 L2 6 Module 4 Define class and object. Given an example for creating a class L2 31. and an object of that class. Explain deep copy and shallow 04 6 copy with suitable example. Discuss operator overloading, mention any 3 operator’s w.r.t 04 L2 32. 5 special functions to be overloaded by python with example. 33. Briefly explain init() and str() with example to each. 04 L2 6 Write a program to create a class called Rectangle with the 04 L2 help of a corner point, width and height. Write following functions and demonstrate their working: 34. 6 a. To find and display center of rectangle b. To display point as an ordered pair c. To resize the rectangle 35. Explain briefly simple, multiple and, multi-level inheritance in 04 L2 6 python with an example to each. Define polymorphism. Demonstrate polymorphism with 04 L2 36. function to find histogram to count number of times each 5 letters appears in word and in sentence. Write a program to create a class Time to represent time in 04 L2 HH:MM:SS format. Perform following operations: a. Overload + to add two time objects b. Overload + to add a numeric value to a time object 37. 5 (commutative) c. Overload __str__() to display time in appropriate format
Discuss operator overloading. Mention any five operators with 04 L2
38. 5 respective special functions to be overloaded in Python. Write a program to create a class called Point with two 04 L2 attributes x and y. Write following functions and demonstrate the working of these functions by creating suitable objects. 39. 6 a. To read attribute values b. To display point as an ordered pair c. To find distance between two points What is pure function? Write a python program to find 04 40. duration of event if start and end time is given by defining L2 4 class TIME. Module 5 What do you mean by API? Explain with suitable SOA L2 41. 05 6 diagram. How do you create data from XML, when XML doc is 05 L2 42. 6 containing multiple nodes? Illustrate with example. Write a python program to retrieve data from a web page using 05 L2 43. 6 urllib and to count the frequency of words in that page. How do you create a database table? Give example. Explain 05 L2 44. 6 the working of database cursor with suitable example. Write a python program that retrieve an user’s Twitter 05 L2 45. friends , parse the returned JSON and extract some of the 8 information about the friends. What is service oriented architecture? List the advantages of 05 L2 46. 4 the same. Explain any 2 socket function. Explain support for parsing 05 L2 47. 8 HTML using regular expression with an example program. Brief on structured Query language, with suitable python 05 L2 48. program explain functions involved in creation of database 8 table in python. Describe a support of security mechanism employed in 05 L2 internet application with support of API usage with an 49. 8 example program to get four strings and put them in “hidden.py” Demonstrate with the help of python construct i) how to 05 L2 50. retrieve an image over HTTP ii) how to retrieve web pages with 8 urllib.