BCC 302 QB

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

INFORMATIONTECHNOLOGY DEPARTMENT

BANSAL INSTITUTE OFENGINEERING & TECHNOLOGY, LUCKNOW

OUESTION BANK FOR PYTHON PROGRAMMING


(BCC302)
Unit 1
Part A (Short Answer)
1. What are the features of Python ?
2. What are the different ways of starting Python ?
3. Which character is used for commenting in Python?
4. Howis Pythonan interpreted language ?
5. What type of language is python?
6. Define the type () function.
7. What do you mean by binary operator ?
8. What is the difference between list and tuples in Python ?
9. What is the difference between Python arrays and lists.
10. Do we need to declare variables withdata types in Python ?
11.Define floor division with example.
12. Mention some of the reserved keyword in Python.
13. Give an example of different types of values to the same variable.
14. Name the tools that are used for static analysis.
15. Define operator associativity with its type.
Part B (Long Answer)

1. Explain the programming cycle for Python.


2. Discuss interaction with Python program with example.
3. What is Python? HowPython is interpreted? What are the tools that help to find bugs or
perform static analysis? What are Python decorators?
4. What do you mean by comments in Python?
5. Explain identifiers and keywords with example.
6. Define variable. Also discuss variable initialization.
7. What do youmean by data types? Explain numeric and string data type with example.
8. Discuss list and tuple data types in detail.
9. Explain dictionary and Boolean data type.
10. What do you mean by type conversion?
11. What is expression?
12. What do you mean by assignment statement?
13. Discuss types of assignment statements with examples.
14. Define the term operator.
15. Discuss arithmetic and comparisonopcralor with example.
16. Explain assignment operator with example.
17. Define bitwise operator with example.
18. Discuss logical and identity operator with example.
19. Explainmembership operator with example.
INFORMATION TECHNOLOGY DEPARTMENT
TECHNOLOGY, LäCKNOW
BANSAL INSTITUTE OF ENGINEERING&

precedence?
20. What do you mean by operator
associativity.
21. Explain operator by Boolean expression?
22.What do you mean PEP 8. Write a Python program to print even
23. How memory is managed in Python? Explain
length words in a string. Unit 2
Part A (Short Answer)

evaluation?
1. What are the factors for expression
2. What is range () function?
range () function.
3. Explain begin and end arguments passed by
4. Define the term alternative execution.
5. What do youmean by block?
6. What are controlstatements?
7. What do you mean by iterative control?
8. Is indentation optional in Python? loop?
9. What happen if break statement is used in for
10. What is raw input( ) function?
Part B (Long Answer)

1. What are conditional statements in Python?


2. Explain if statement with the help of an example. help of an example.
3. What do youmean by if-else statement? Explain with the
4.. Discuss the Nested-if statement with the help of example.
5. Explain elif statement in Python.
or odd.
6. Write a program to find whether a number is even
numbers.
7. Writea program to check the largest among the given three not.
8. Write a Python program to check if the input year is a leap year or
teams.
9. Write a Python program to display the Fibonacci sequence for n
10. What do you mean by expression evaluation?
11. Discuss float representation in Python.
with example. Write a Python
12. Explain expression evaluation and float representationnumber.
Fibonacci
program for how to check if a given number is
13. Define loop. Also, discuss the purpose and working of loops.
14. Discss while loop in brief.
15. Explain for loop with the help of example.
16. What is nested loop? Explain.
17. What is break statement in Python?
18. Explain continue statement with example.
break and continue with example. Write
19. Explain the purpose and working of loops. Discuss 24-hours
aPython program to convert time from 12 hours to format.
else.
20. Write a program to demonstrate while loop with
21. Write a Python programto print the numbers for a user provided range.
INFORMATION TECHNOLOGY DEPARTMENT
BANSAL INSTITUTEOF ENGINEERING & TECHNOLOGY,LUCKNOW

22. Differentiate between for and while loop.


23. Explain the purpose and working of loops.
Unit 3
Part A (Short Answer)

1. Define traversing of string.Give an example.


2. What are escape characters?
3. What do you mean by tuple assignment?
4. What do you mean by Lists are mutable"?
5. What are the different methods used in deleting elements from dictionary?
6. What are the two properties of keyin the dictionary?
7. Why we use functions?
8. What åre mathematical functions? How are they used in Python?
9. What are user-defined functions? Give the syntax.
10. Define anonymous function.
11. Write a function called sumallI) that takes any number of arguments and returns their sum.
12. Give examples for all, any, len and sorted methods in dictionary.
13. What is the output of print list[2] when list = ['abcd', 2.23, 'john']?
14.What is slicing?
15. What are local variables and global variables in Python?
Part B(Long Answer)
1. Define function and write its advantages.
2. How to define and call function in Python? Explain different
3. Discuss the execution of a function with the help of example.
4. What do you mean by keyword and default arguments?
5. Discuss the scope rules in Python.
6. Discuss function in Python with its parts and scope. Explain with exanmple. (Take simple
calculator with add, subtract, division and multiplication).
7. What do you mean by the term strings?
8. What is len() function?
9. Discuss the concatenationand repeat operation in Python with example.
10. What do you mean by string slices?
11.Explain the term indexing in Python.
12. Define tuples. How tuples arccreatcd in Python?
13. How are the values in a tuple accessed?
14. Explain tuples as return values and variable-length arguments tuples with the help of
example.
15. Explain the basic operation of tuples with example.
16. What do youmean by unpacking sequences'? Giveexample to explain.
17. Write short note on list.
in list.
18. Explain the copying methodfrom
19. How elements are deleted a list?
INFORMATION TECHNOLOGY DEPARTMENT
BANSAL INSTITUTEOF ENGINEERING & TECHNOLOGY, LUCKNOw

20. Discuss built-in list operators in detail.


21. Write variousbuilt-in list methods. Explain any three with example.
22. What are mutable sequences? Discuss with example.
23. Define the ternm list comprehension.
24. What do you mean by sets? Explain the operations performed on sets.
25. What is dictionary in Python?
26. How do we create a dictionary in Python?
27. Explain the operations performed on dictionary with example.
28. Write some built-in dictionary methods used in Python with example.
29.Explain treat functions are first-class objects in detail.
30. Explain Lambda expression.
31. Explain high order function with respect to lambda expression. Write a Python code to count
occurYences of an element in a list.
32. Explain unpacking sequences, mutable sequences and list comprehension with example.
Write a program to sort list of dictionaries by values in Python - using lambda function.
33. Write a function to find the ASCIIvalue of the character.

Unit 4
Part A (Short Answer)

1. List the order of file operations in Python.


2. Explain any four modes of opening the file.
3. Explain the file object attributes in detail.
4. Give the syntax for reading from a file. What is the work of the readline() function ?
5. How are renaming and deleting performed on a file ? Give the syntax for each.
6. List the various modes in which youcan open a file in python.

Part B (Long Answer)

1. What are files? How are they useful?


2. Describe the opening a file function in Python.
3. Explajn the closing a file method in Python.
4. Discuss writing to a file operation.
5. Explain reading from a file operation with example.
6. Discuss file 1/O in Python.How to perform open, read, write, and close into a file? Write a
Python program to read a file line-by-line store it into a variable.
Unit 5
Part A(Short Answer)
1. List some Python IDEs.
2. What are the advantages of numpy?
3. Give some advantages ofpandas.
4. Explain any two features of NumPy.
INFORMATION TECHNOLOGY DEPARTMENT
BANSAL INSTITUTE OF ENGINEERING & TECHNOLOGY, LUCKNOW

5. Which method is used to convert a csy file to a DataFrame?


6. Which method is used to create a horizontal bar graph?
Part B (Long Answer)

1. What is IDE? Discuss some Python IDE.


2. List any five Python IDE and explain their features. from Python
3. Describe the features of NumPy. Discuss NumPy Array and how it is different
List.
find mean and median of the same
4. Write.a python program to create a 2D NumPy Array and
array.
5. Describe the python library Pandas. What are its features? application.
6. What is a DataFrame and a Series? Discuss their functions with their
used in matplotlib.
7. Describe the Matplotlib library in python. State various data visualization
Draw a pie chart in python for the number of boys and girls in on a classroom by the input
8. legends the chart.
given by the class teacher. Also, show the labels, title and
python for the ages of the
9. How a Bar graph different from Histogram? Draw a histogram in
students studying the in classroom.
form in python using all
10. Describe the tkinter library in python. Display student registration
the necessary widgets of tkinter.

You might also like