0% found this document useful (0 votes)
56 views3 pages

Python Programming Question Bank

The document is a chapter-wise question bank for Python programming, covering topics such as data types, operators, decision making, loops, functions, modules, and file operations. Each chapter includes a series of questions and programming tasks designed to assess understanding and application of Python concepts. Additionally, it touches on libraries like NumPy and Pandas, along with practical exercises involving data manipulation and visualization.

Uploaded by

luffy spice
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)
56 views3 pages

Python Programming Question Bank

The document is a chapter-wise question bank for Python programming, covering topics such as data types, operators, decision making, loops, functions, modules, and file operations. Each chapter includes a series of questions and programming tasks designed to assess understanding and application of Python concepts. Additionally, it touches on libraries like NumPy and Pandas, along with practical exercises involving data manipulation and visualization.

Uploaded by

luffy spice
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

Python programming (3154804)

chapter-wise question bank

Chapter 1: Introduction, Data Types, and Operators


1. Define Python? List the important features of python. (3)
2. List the advantage and disadvantage of python. (3)
3. What are key features of python? (3)
4. Explain how string is converted into a list? Convert String S = "GTU Supports Innovation"
into a list. (3)
5. Briefly explain Data types and Variable in Python. (3)
6. Describe the various data types in Python (e.g., integer, float, string, boolean, list, tuple,
dictionary). (7)
7. What are common built-in data types in python? (7)
8. Differentiate between List and Tuple. (4)
9. What is tuple? What is the difference between list and tuple? (4)
10. How is a list different from a tuple? Write the advantages of a tuple. (4)
11. Differentiate between List, Tuple, Set and Dictionary. (7)
12. Demonstrate Membership operators and identity operators with suitable examples. (7)
13. Describe mathematical and logical operators in python. (7)
14. Describe Arithmetic Operators, Assignment Operators and Bitwise Operators in detail with
examples. (7)
15. Explain and categorize operators in python. (7)
16. Explain the difference between = and == in Python. Provide an example where each of these
is used. (3)
17. What is type conversion in python? Explain with the help of a suitable example. (7)
18. What is type conversion in Python? Differentiate between implicit and explicit type
conversion with examples. (4)
19. Explain the is and is not operators with an example. (3)
20. What are negative indexes and why are they used? (3)
21. Write short notes on different types of operators in python with appropriate examples. (7)
22. Write a Python program to compute the sum, difference, product, and quotient of two
numbers and print the output for each of them. (3)
Chapter 2: Python Decision Making and Loops
23. Explain while loop in python. How to create an infinite while loop? How to break an infinite
while loop in a certain condition? Explain with an example. (7)
24. Explain for loop in detail. (3)
25. Explain the structure of a for loop in python with a suitable example. (3)
26. Explain while loop in python. How to create an infinite while loop? How to break an infinite
while loop in a certain condition? Explain with an example. (4)
27. Describe for loop with an example. (4)
28. Explain the use of break, continue and pass statement in python. (4)
29. Explain the use of pass, break and continue statement in python. (4)
30. Describe elsif ladder structure and nested if..else statement. (4)
31. Write a Python program to generate a pyramid pattern. (7)
32. Write Python code to print the following pattern using a nested loop. (7)
33. Write a Python program to get temperature and humidity from the user and display messages
in different situations using if and nested if. (7)
34. Write a Python program to find the sum of all Odd numbers up to a number specified by the
user. (4)
35. Write Python program to find the sum of first N numbers using a while loop. (Take N as user
input). (4)

Chapter 3: Python Functions and Modules


36. Write a Python function to sum all the numbers in a list. (3)
37. What is a function? Mention the type of function and use. (3)
38. Discuss global, local and nonlocal variables in detail. (4)
39. What are local variables and global variables in python? (3)
40. Develop a python program to find the maximum, minimum and average of given numbers
using a user-defined function. (7)
41. Define a function named even. This function expects a number as an argument and returns
True if the number is divisible by 2, or it returns False otherwise. (4)
42. Write a Python function to calculate the factorial of a number (a non-negative integer). The
function accepts the number as an argument. (7)
43. Write a Python Program to find the sum of digits in an entered number by the user and print
the sum. Prompt the user to get the input number. (7)
44. Give comparison between Tuple and List in python.
45. Describe filter method/function available in python with an example. (4)
46. Explain the conversion of list to dictionary in python.
47. What is set in python? Explain various methods that can be used with sets in python.

Chapter 4: Python File Operations


48. Write a python program to read data from "[Link]", if data is negative write it in
"[Link]" and if data is positive write it in "[Link]". (7)
49. Write a python program to count words, characters and spaces from a text file.
50. Write a python program to read a text file and count the number of lines in a file.
51. Explain file exception handling. What are the reasons for file exceptions?
52. Explain various ways to open a file. Also discuss various modes to open a file with suitable
example.
53. With the help of suitable example explain how can we read and write to a CSV file in python?
54. Enlist python errors. Describe try-except block with example.
55. Explain different mode for opening a file in python.
56.

57. Chapter 5: MicroPython


58. Discuss the use of NumPy library.
59. Discuss the use of Pandas library.
60. Create a NumPy array using random function in NumPy. Also demonstrate to compute mean,
median and variance for created NumPy array.
61. Write a simple python program that plot the line graph with X = [1,2,3,4,5] and Y =
[1,4,9,16,25]. Also give label “X-axis” and “Y-axis” to respective axis.
62. Create a DataFrame from the .csv file using pandas. Also demonstrate the use of loc and iloc
on created DataFrame.
63. Create a NumPy arrays, arr1 with value range from 1 to 5 and arr2 with value range from 3 to
7, and plot a graph

You might also like