0% found this document useful (0 votes)
54 views6 pages

Question Bank

The document outlines a comprehensive curriculum for learning Python, divided into four units covering topics such as selections, loops, functions, data structures, file handling, and exception management. It includes both 1-mark and essay questions for each unit, designed to assess understanding and application of Python concepts. Additionally, it lists various programming exercises to reinforce learning through practical implementation.

Uploaded by

shaikjaveed2240
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views6 pages

Question Bank

The document outlines a comprehensive curriculum for learning Python, divided into four units covering topics such as selections, loops, functions, data structures, file handling, and exception management. It includes both 1-mark and essay questions for each unit, designed to assess understanding and application of Python concepts. Additionally, it lists various programming exercises to reinforce learning through practical implementation.

Uploaded by

shaikjaveed2240
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

🟩 UNIT I: Introduction to Python & Selections

✅ 1-Mark Questions:

1. What is the extension of a Python file?

2. Define an identifier in Python.

3. Write a syntax for a simple if statement.

4. What is the result of 5 // 2 in Python?

5. Name two Boolean operators in Python.

6. What is operator precedence?

7. What is the purpose of input() function?

8. Differentiate between = and == operators.

9. Mention any two types of programming errors.

10. Write one example of a named constant in Python.

📝 Essay Questions:

1. Explain various data types and operators used in Python with examples.

2. Discuss the different types of selection statements with syntax and examples.

3. Describe the programming style and documentation in Python.

4. Explain the concept of expressions and type conversions with examples.

5. Write a Python program that reads two numbers and displays the greater number using
if-else.

🟩 UNIT II: Loops and Functions

✅ 1-Mark Questions:

1. What is the syntax of a while loop?

2. Write a use of the break keyword.

3. What is meant by default argument?


4. What is a function in Python?

5. Name the loop which executes at least once.

6. Define scope of a variable.

7. What is recursion?

8. What is the difference between positional and keyword arguments?

9. What is meant by returning multiple values in a function?

10. Write the syntax to define a function in Python.

📝 Essay Questions:

1. Differentiate between while and for loops with suitable examples.

2. Explain the various types of function arguments in Python.

3. Write a Python program to calculate the factorial of a number using recursion.

4. Discuss function abstraction and stepwise refinement in detail.

5. Explain nested loops with an example.

🟩 UNIT III: Lists, Tuples, Sets, and Dictionaries

✅ 1-Mark Questions:

1. How do you define a list in Python?

2. Mention two differences between list and tuple.

3. What function is used to copy a list?

4. How do you create a dictionary in Python?

5. Name any two set operations.

6. What is an immutable data type? Give example.

7. How do you add an element to a set?

8. What is the output of len([1,2,3])?

9. What is the method to retrieve keys from a dictionary?

10. Write the syntax for defining a tuple.


📝 Essay Questions:

1. Compare and contrast Lists and Tuples with suitable examples.

2. Explain how to pass lists to functions and return from them.

3. Discuss various set operations and their use cases.

4. Write a Python program to demonstrate use of dictionary for storing student names and
marks.

5. Explain searching in lists and performance differences between lists and sets.

🟩 UNIT IV: Files, Exception Handling, Recursion

✅ 1-Mark Questions:

1. What is the purpose of the try block?

2. Define file in Python.

3. Write one example of raising an exception.

4. What is tail recursion?

5. Mention one method for file writing.

6. What is the output of open("file.txt", "r")?

7. Define an exception.

8. What is the purpose of finally block?

9. Differentiate between recursion and iteration.

10. What is a helper function?

📝 Essay Questions:

1. Explain text file input and output operations with examples.

2. Discuss exception handling in Python using try, except, finally blocks.

3. Write a recursive function to compute the nth Fibonacci number.

4. Explain how to retrieve data from the web using Python.

5. Compare recursion and iteration with examples.


🟩 UNIT I: Introduction to Python, Programming Style, Selections

S.No Program Title

1. Program to perform arithmetic operations and demonstrate operator precedence

2. Program to read input from user and display output

3. Program to swap two numbers using simultaneous assignment

4. Program to demonstrate use of type conversion functions

5. Program to find maximum of two numbers using if-else

6. Program to check even or odd number

7. Program to generate a random number and compare with user input

8. Program to demonstrate if-elif-else for grading system

9. Program to demonstrate use of logical operators in decision making

10. Program to format strings and numbers using .format()

🟩 UNIT II: Loops and Functions

S.No Program Title

1. Program to print first N natural numbers using while loop

2. Program to find factorial using for loop

3. Program to print multiplication table using nested loop

4. Program to demonstrate use of break and continue

5. Program to define and call a simple function

6. Program with default arguments and keyword arguments

7. Program to return multiple values from a function

8. Program to pass values by reference to a function


S.No Program Title

9. Program to demonstrate variable scope

10. Program to use helper function and stepwise refinement

🟩 UNIT III: Lists, Tuples, Sets, Dictionaries

S.No Program Title

1. Program to create and access list elements

2. Program to copy a list and demonstrate list slicing

3. Program to pass list to a function and return list

4. Program to search for an element in a list

5. Program to create and access tuple elements

6. Program to create a set and perform set operations (union, intersection)

7. Program to compare performance of set vs list in searching

8. Program to create a dictionary and retrieve values using keys

9. Program to iterate through a dictionary using .items()

10. Program to update and delete dictionary elements

🟩 UNIT IV: Files, Exception Handling, Recursion

S.No Program Title

1. Program to write to a text file

2. Program to read from a text file

3. Program to read and write multiple lines to a file

4. Program to retrieve data from the web using urllib (introductory)

5. Program to handle divide by zero exception

6. Program to raise and catch a custom exception


S.No Program Title

7. Program using try-except-finally structure

8. Program to demonstrate recursion to calculate factorial

9. Program for Fibonacci series using recursion

10. Program comparing recursion and iteration for calculating power

You might also like