Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
116 views

Python Important Questions

some important question for introduction to python vtu

Uploaded by

carrediehere
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views

Python Important Questions

some important question for introduction to python vtu

Uploaded by

carrediehere
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Python important questions

Module 1
1. With Python programming examples to each, explain the syntax and control flow diagrams of break
and continue statements.
2. Explain TWO ways of importing modules into application in Python with syntax and suitable
programming examples.
3. Write a function to calculate factorial of a number. Develop a program to compute binomialcoefficient
(Given N and R).
4. Explain looping control statements in Python with a syntax and example to each.
5. Develop a Python program to generate Fibonacci sequence of length (N). Read N from the console.
6. Develop a Python program which reads two values from the console and calls a function DivExp.
7. Explain FOUR scope rules of variables in Python.
8. What is a String? Explain String Concatination and Replication.
9. Write a python program and explain the following functions: int(), str(), float(), print(), len() and
input().
10. With flow diagram and example program explain Continue and Break statement.
11. Read a multi-digit number (as chars) from the console. Develop a program to print the frequency of
each digit with suitable message.
12. Brief Slicing in list with an example and explain with a programming example to each: (i) get() (ii)
setdefault()
13. Explain local and global scope in python.
14. Define exception handling. How exception handling is done in python with program to solve divide by
zero exception.
15. What are functions? Explain python functions with parameters and return value.

Module 2
16. Explain with a programming example to each: (ii) get() (iii) setdefault()
17. Develop suitable Python programs with nested lists to explain copy.copy( ) and copy.deepcopy( )
methods.
18. Explain negative indexing, slicing(), append() and index(), sort(),remove()methods with respect to lists
in Python.
19. Explain different ways to delete an element from a list with suitable Python syntax and programming
examples.
20. Read a multi-digit number (as chars) from the console. Develop a program to print the frequency of
each digit with suitable message.
21. Program to find mean, variance and standard deviation.
22. Explain use of in and not in operators.
23. Tuples are immutable. Explain with Python programming example.

Module 3
24. Explain Python string handling methods with examples: split(),endswith(), ljust(), center(),
lstrip(),join(), startswith(),rjust(),strip(),rstrip().
25. Explain with suitable Python program segments: (i) os.path.basename() (ii) os.path.join().
26. Explain reading and saving python program variables using shelve module with suitable Python
program.
27. Develop a Python program to read and print the contents of a text file.
28. Develop a Python program find the total size of all the files in the given.
29. Develop a program to sort the contents of a text file and write the sorted contents into a separate text
file.
30. Explain with example isalpha(), isalnum().
Module 4
31. Explain permanent delete and safe delete with a suitable Python programming example to each.
32. Develop a program to backing Up a given Folder (Folder in a current working directory) into a ZIP File
by using relevant modules and suitable methods.
33. Explain the role of Assertions in Python with a suitable program.
34. Explain the functions with examples: (i) shutil.copytree() (ii) shutil.move()
(iii) shutil.rmtree().
35. Difference between shutil.copy() and shutil.copytree().
36. Develop a Python program to traverse the current directory by listing subfolders and files.
37. Explain the support for Logging with logging module in Python.

Module 5
38. Explain the methods __init__ and __str__ with suitable code example to each.
39. Explain the program development concept ‘prototype and patch’ with suitable example.
40. Explain the following with syntax and suitable code snippet: i) Class definition ii) instantiation iii)
passing an instance (or objects) as an argument iv) instances as return values.
41. Define pure function and modifier. Explain the role of pure functions and modifiers in application
development with suitable python programs.
42. Define class and object, construct class called rectangle and initialize it with
height=100,width=200.Write a program to display the center of a rectangle.
43. Explain printing of objects.

You might also like