0% found this document useful (0 votes)
13 views2 pages

UNIT WISE ASSIGNMENT _PYTHYON.pdf

The document outlines assignments for a Python Programming course at BBS College of Engineering & Technology, covering topics such as operators, Python's interpreted nature, data types, programming cycles, and error handling. It includes tasks like writing code snippets for Fibonacci sequences and prime number generation, as well as comparisons between data structures like lists and tuples. Additionally, it discusses concepts like iterators, conditional statements, loops, and expression evaluation.

Uploaded by

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

UNIT WISE ASSIGNMENT _PYTHYON.pdf

The document outlines assignments for a Python Programming course at BBS College of Engineering & Technology, covering topics such as operators, Python's interpreted nature, data types, programming cycles, and error handling. It includes tasks like writing code snippets for Fibonacci sequences and prime number generation, as well as comparisons between data structures like lists and tuples. Additionally, it discusses concepts like iterators, conditional statements, loops, and expression evaluation.

Uploaded by

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

BBS College of Engineering & Technology

Phaphamau, Prayagraj

Department of Computer Science & Engineering

SUBJECT: PYTHON PROGRAMMING


SUBJECT CODE: (BCC302)
SUBMISSION DATE: 7TH JAN 2025

UNIT 1 ASSIGNMENT
1. Discuss various categories of operators in python. Find and explain stepwise solution
of following expressions if a=3, b=, c=10
(a) a&b<<2//5*2+c^b
(b) b>>a**2<<2>>b**2 ^c**3
2. Discuss why python is interpreted language. Explain history and features of python
while comparing python versions 2 and 3.
3. Answer the following question in brief.
(a) Discuss why python is called as dynamically or strongly typed language.
(b) Programming cycle of python.

4. Explain in brief.

(a) Explain the role of precedence with an example.


(b) Consider the program.
X=[‘12’,’hello’,456]
X[0]*=3
X[1][1]=’bye’
Explain why this program generates an error.

5. What is the short circuit evaluation? What is printed by the following python program.
A=0
B=2
C=3
X=C or A
print(X).

6. Answer in brief.
(a) In some language every statement ends with a semi-colon. What happens if you
put a semi-colon at the end of python statement?
(b) Mention five benefits of using python.

7. What is python? What are the tools that help to find bugs or perform static analysis?
What are python decorators?

8. Write short notes with example.


(a) Elements of python.
(b) Type conversion in python.
(c) Operator precedence.
(d) Boolean expressions.
BBS College of Engineering & Technology
Phaphamau, Prayagraj

Department of Computer Science & Engineering

9. Explain in brief.
(a) What type of language is python.
(b) What are local and global variables in python.
(c) Define floor division with example.

UNIT 2 ASSIGNMENT
1. Write python code snippet for displaying ‘n’ terms of Fibonacci using recursion.
2. Write a program to generate prime number.
3. Compare list and tuple data structure with example. Explain list comprehension.
4. Answer in brief.

(a) Type conversion in python.


(b) Write a program to print number from 0 to 57 using range.
5. Write a program to check an input year is leap year or not.
6. Discuss concepts of iterators with example.
7. Answer the following questions:

(a) What is the use of raise statement? Describe with an example.


(b) Which of the following statements produce an error in python?
x, y, z= 1,2,3 #s1
a, b = 4,5,6 #s2
u = 7, 8, 9 #s3
(List all statement that have an error.)
8. Explain all conditional statement in python using small code example.
9. Explain purpose and working of loops. Discuss break and continue with example.
Write a python program to convert time for 12 hour to 24 hour format.
10. Explain expression evaluation and float representation with example. Write a python
program to check if a given number is Fibonacci number.

You might also like