0% found this document useful (0 votes)
5 views7 pages

Python All Unit Important Questions

The document outlines a structured curriculum for learning Python, divided into five units, each containing 2-mark and 7-mark questions. Topics include Python benefits, data types, operators, control flow, file handling, and modules, along with practical programming exercises. The curriculum emphasizes both theoretical understanding and practical application through coding tasks.

Uploaded by

pradeeps03143
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
5 views7 pages

Python All Unit Important Questions

The document outlines a structured curriculum for learning Python, divided into five units, each containing 2-mark and 7-mark questions. Topics include Python benefits, data types, operators, control flow, file handling, and modules, along with practical programming exercises. The curriculum emphasizes both theoretical understanding and practical application through coding tasks.

Uploaded by

pradeeps03143
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 7

Python important

Unit-1
2-marks question

a) Write the benefits of Python.


b) Define floor division with example.
c) What type of language is Python?
d) How is Python an interpreted language?
e) Define the type () function.
f) What will be the output of the following Python code?
i=0
while i< 3:
print(i)
i += 1
else:
print (0)
g) What happens if you put a semicolon (;) at the end of Python statement.
h) What are rules for naming variables in Python.
i) Explain the role of precedence with an example.
j) List the categories of operators.

7-marks question

a) What do you mean by Data type in Python. Explain in details.


b) Discuss various categories of operators in Python.
c) Explain the local and global variables in Python.
d) Write a Python program to swap two numbers.
e) What do you mean by operator precedence and associativity?
f) Write a Python program to find the given year is leap or not.
g) Implement Python program to find sum of natural numbers.
h) What is the difference between intermediate mode and script mode?
i) What are Python strings? Explain with details.
j) What are keywords and how they are important in Python?

Unit-2
2- marks question

a) What will be the output of the following Python code?


def cube(x):
return x * x * x
x = cube(3)
print x
b) Write a Python program to add an item in a tuple.
c) How to create and import a module in Python?
d) What is object-oriented programming (OOP) in Python? Give an
example.
e) Discuss the purpose of the break and continue statement in loop.
f) Describe the behavior of “range (s,e)” in Python.
g) Differentiate between Python lists and tuples?
h) What are local and global variables in Python?
i) What is range function? Explain with example.
j) What do you mean by block in Python?

7- marks question

a) Explain Tuples and Unpacking Sequences in Python Data Structure.


b) explain the following loop with flow diagram, syntax and suitable
example:
(1) For loop
(2) While loop
c) Explain the continue, break, and pass statements with a suitable
example.
d) Discuss the different types of argument-passing methods in Python.
Explain the variable length argument with any suitable example.
e) Explain all the conditional statement in Python using small code
example.
f) Explain in detail about Control flow structures in Python.
g) Write a Python program to find the given number is odd or even.
h) Write and explain an algorithm through Python code to generate prime
numbers.
i) Discuss the nested if-else statement with the help of example.
j) Write a Python code to check if the input year is a leap year or not.

Unit-3
2 marks question

a) What is Tuple in Python?


b) Describe the concept of List Slicing with a suitable example.
c) Differentiate between Python Arrays and lists?
d) Explain the difference between 'append' and 'extend' in Python?
e) What is a dictionary in Python?
f) What will be the output of the following Python code
def count1(s):
vowels = "AEIOUaeiou"
count = 0
for c in s:
if c in vowels:
count += 1
return count
print(count1(‘I love India’))
g) What will be the output of the following code?
list1 = ['M', 'o', 'n', 'k', 'y']
print("@".join(list1))
h) What will be the output of following Python code?
I=0
While i<3:
Print(i)
I+=1
else:
print (0)
i) Why function is used in Python?
j) Write a Python program to print factorial of a given number.

7 marks question

a) Write a program to produce Fibonacci series in Python.


b) Demonstrate five different built in functions used in the string. Write a
program to
check whether a string is a palindrome or not.
c) Explain the list Comprehension with any suitable example.
d) Discuss list data structure of Python. Explain various inbuilt methods of
list with
suitable example of each.
e) How you can randomize the items of a list in place in Python.
f) Write a program that accepts a sentence and calculates the number of
digits,
upper case and lowercase letters.
g) Define the function and write its advantages.
h) Discuss the different types of argument-passing methods in Python.
i) Explain the term indexing in Python.
j) Define the tuples. How tuples are created in Python?
Unit-4
2-marks question

a) How do you perform a search in Python?


b) Explain any four modes of opening the files.
c) Discuss various file opening modes of Python.
d) What is file and its types in Python?
e) Explain about the import statement in modules.
f) What is difference between read () and readlines () function?
g) What is difference between write () and writelines () function?
h) Explain the seek function with example.
i) Describe the opening a file function in Python.
j) Explain the closing a file method in Python.

7-marks question

a) What are File input and output operations in Python Programming?


b) Demonstrate the file handling procedure in detail. Write a Python code to
create a
file with ‘P.txt’ name and write your name and father’s name in this file and
then read this file to print it.
c) How can you use seek () function to reset the read/write position to
specify
location.
d) What is Python module? How to create and import a module in Python.
e) Discuss some below statements with examples:
(1) Read ()
(2) Readlines ()
(3) Write ()
(4) Writelines ()
f) Discuss writing to a file operation.
g) Discuss reading to a file operation with example.
h) Write the steps to use the seek() function to move write position to the
beginning
of a file.
i) Which method is used to read the contents of a file which is already
created?
j) Explain in detail about Python Files, its types, functions and operations
that can be
performed on files with examples.

Unit-5
2-marks question

a)How to create and import a module in Python?


b) Define the programming cycle for Python.
c) Explain the features of any two Python IDEs.
d) Discuss why Python is called as dynamic and strongly typed language.
e) Explain package installation via pip.
f) What are packages? Give an example of package creation in Python.
g) What is searching? Explain with example program.
h) What is PIP?
i) Differentiate between built-in packages and user define packages.
j) How you can install the Python package

7-marks question

a) What do you mean by Python IDE? Explain in detail.


b) How to import a module in Python?
c) What do you mean by Data type in Python. Explain in details.
d) Discuss function in Python. Write the code for simple calculator with add,
subtract,
division and multiplication.
e) What is Tkinter and why it is used in Python programming?
f) Demonstrate about the GUI programming in Python
i.Circle
ii.Triangle
iii.Rectangle
g) What is Numpy package? Explain with examples in detail.
h) What is Pandas package? Explain with examples in detail.
i) What is Python? How is Python interpreted? What are the tools that help
to find
bugs or perform static analysis?
j) Write the steps in detail to install the packages in Python.

You might also like