Assignment No.1-PWP
Assignment No.1-PWP
-1
1. How to give single and multiline comment in Python
2. List data types used in Python. Explain with example
3. Explain logical and assignment operators with example
4. List features of Python.
5. Describe membership operators in python.
6. Explain Bitwise operator in Python with appropriate example.
7. Enlist applications for python programming.
8. Describe the Role of indentation in python.
9. Explain building blocks of python.
10. List comparision operators in Python
Assignment No.-2
1. List comparision operators in Python
2. Write python program to illustrate if else ladder.
3. Write Python code for finding greatest among four numbers.
4. Explain decision making statements If - else, if - elif - else with example.
5. Write python code to count frequency of each characters in a given file.
6. Write a Python Program to check if a string is palindrome or not.
7. Write a Python program to find the factorial of a number provided by the user.
8. Write python program to display output like.
2
468
10 12 14 16 18
9. Write the use of elif keyword in python.
10. Explain decision making statements If - else, if - elif - else with example.
Assignment No.-3
1. Explain two ways to add objects / elements to list
2. Explain four built-in list functions.
3. T = (‘spam’, ‘Spam’, ‘SPAM!’, ‘SaPm’)
print (T [2] )
print (T [-2] )
print (T [2:] )
print (List (T) ) what is the output of this code?
4. Explain different functions or ways to remove key : value pair from Dictionary.
5. Explain any four set operations with example.
6. List and explain any four built-in functions on set.
7. List features of Python.
8. Write down the output of the following Python code
>>>indices=['zero','one','two','three','four','five']
i) >>>indices[:4]
ii) >>>indices[:-2]
9. Explain creating Dictionary and accessing Dictionary Elements with example.
10. Write a python program to input any two tuples and interchange the tuple
variables.
11. Differentiate between list and Tuple.
12. Write a Python Program to accept values from user in a list and find the largest
number and smallest number in a list.
13. Explain any six set function with example.
14. List comparision operators in Python.
15. Write any four methods of dictionary.
16. Write basis operations of list.
17. Compare list and dictionary.
18. Write python program to perform following operations on Tuples;
i) Create set
ii) Access set Element
iii) Update set
iv) Delete set
19. Explain mutable and immutable data structures.
20. Write the output of the following :
i) >>> a = [ 2, 5, 1, 3, 6, 9, 7 ]
>>> a [ 2 : 6 ] = [ 2, 4, 9, 0 ]
>>> print (a)
ii) >>> b = [ “Hello” , “Good” ]
>>> b. append ( “python” )
>>> print (b)
iii) >>> t1 = [ 3, 5, 6, 7 ]
>>> print ( t1 [2] )
>>> print ( t1 [–1] )
>>> print ( t1 [2 :] )
>>> print ( t1 [ : ] )