Assignment 1-3
Assignment 1-3
Unit 2
Q1. Explain Membership operator
Q2. Explain Identity Operator
Q3. Explain Conditional Statement in python
Q4. Explain Whille loop in python
Q5. Explain Continue, Pass and Break statement in python
Unit 3
Q1. Differentiate between list and tuple
Q2. 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 [:])
Q3. Explain Four built-in Tuple function in Python
Q4. Give any six set operation in python
Q5. Write a program to create dictionary of students that
includes their ROLL NO. and NAME.
i) Add three students in above dictionary
ii) Update name = ‘Shreyas’ of ROLL NO = 2
iii) Delete information of ROLL NO = 1