Xi PWT4
Xi PWT4
SECTION D (4*2=8)
1) What will be the output displayed at Line3, Line 5 and Line 7 of following
Python code:
data = [2,5,6,2,7,5,2,9,11,18,2,4]
val = data.pop()
print(val)
# Line 3
data.extend([100,200])
print(len(data))
# Line 5
c = data.count(2)
print(c)
# Line 7
2) Write a program to input two numbers and swap them.
SECTION E (5*1=5)
1) Ms Anvi is python learner he developed code for small python programs Write The code
in python to print the following pattern using nested loop-
12345
1234
123
12
1