Sunteți pe pagina 1din 1

Python Application Programming

II IA Question Bank
1. Explain exception handling in python. Explain with example
2. Describe any two list operations and list methods. Write a python program to accept ‘n’ numbers
from user, find sum all even numbers and product of all odd numbers in entered list. (8M)
3. Write a python program to accept USN and marks obtained. Find maximum, minimum and
students USN who have scored in the range 100-85, 85-75, 75-60 and below 60 marks separately.
(8M)
4. Explain string slicing in Python. Show with examples. (4M)
5. Write a Python program to accept a sentence from the user and display the longest word of that
sentence along with its length. (06M)
6. List and explain any four built in string manipulation functions supported by Python. (06M)
7. Write the python code to display the last six characters of the string “Make hay while the
sunshines” in the console. (3M)
8. Write a Python program to accept a file name from the 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. (7M)
9. What are lists? Lists are mutable. Justify the statement with examples. Discuss various built-in
methods in lists
10. How tuples are created in Python? Explain different ways of accessing and creating them.
11. Write a python program to read all the lines in a file accepted from the user and print all email
address contained in it. Assume the email address contain only non-white space characters.
12. Explain dictionaries. Demonstrate with a Python program.
13. Implement a Python program using lists to store and display N integers accepted from the user.
14. Compare and contrast tuples with lists. Explain the following operations in tuples
i) sum of two tuples
ii) slicing operator
iii) Compression of two tuples
iv) Assignment to variables
15. Explain dictionary in Python. Give example. Briefly discuss key-value pair relationship in
dictionaries.
16. Explain get() function in dictionary with suitable code snippet.
17. Consider the list scores = [5, 4, 7, 3, 6, 2, 1] and write the python code to perform the following
operations:
i) Insert an element 9 at the beginning of the list.
ii) Insert an element 8 at the index position 3 of the list.
iii) Insert an element 7 at the end of the list.
iv) Delete all the elements of the list.
v) v) Delete an element at the index position 3.
vi) Delete an element at the beginning of the list.
18. Write a python program to copy all lines beginning with vowels from FROM.txt file to VOWEL.txt
file retaining other lines. (8M)
19. List and explain any four built in string manipulation functions supported by Python. Explain string
slicing in Python. Show with examples.

S-ar putea să vă placă și