0% found this document useful (0 votes)
3 views1 page

Python Programming Assignment Guide

Uploaded by

avinashgkp1919
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)
3 views1 page

Python Programming Assignment Guide

Uploaded by

avinashgkp1919
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

INSTITUTE OF TECHNOLOGY & MANAGEMENT

Integrated Technical Campus: Engineering, Pharmacy & Management


Approved by AICTE, Pharmacy Council of India, New Delhi & Affiliated to Dr. APJAKTU, Lucknow
AL-1, Sector - 7, GIDA, Gorakhpur - 273209 (UP)

Assignment -2
Issue Date: 27-05-25 Submit Date: 05-06-25
[Link]
Q1(a) Evaluate
a. 2**6//8%2
b. 9**2//5-3
c. 10+6-2%3+7-2
Q1(b) Write all string methods with proper example.
Q2(a) Write a program to take an empty list and add ten elements in list by using for loop.
Q2(b) Given a number n we wish to do following :
a. if n is positive – print n*n , set flag to true
b. if n is negative – print n*n*n , set a flag to true
c. if n is 0 – do nothing .

Q3(a) Write a program that swap the values of variables a and b. You are not allowed to use a
third variable. You are not allowed to perform arithmetic on a and b.
Q3(b) A five digit number is entered through keyword. Writ a program to obtain the reversed
number and to determine whether the original and reverse numbers are equal or not.
Q4(a) Write a program to print all prime number between 1 to 100
Q4(b) Write a program to implement a stack data structure. Stack is last in first out list in which
addition and deletion take place at the same end.
Q5(a) Write a python program to perform following operations:
a) pack first 10 multiple of 10 into tuple
b) Unpack the tuple into 10 variables.
c) Unpack the tuple such that first value store in x , last value store in y and all
values in between store in a single variable.

Q5(b) Tuple (‘F’,’I’,’a’,’b’,’e’,’r’,’g’,’a’,’s’,’t’,’e’,’d’). Write a python program to carry out the


following operation.
a) Add an ! at the end of tuple
b) Convert a tuple to string
c) Check whether ‘r’ exit in the tuple
d) Delete character ‘b’,’b’,’e’,’r’ from the tuple

You might also like