Page 264 - Ai_V1.0_Class9
P. 264
h. Input five subject's marks in a list and print the percentage of all.
i. Create a list with heterogeneous values and print the values which are only integer.
j. Create a list of five subject's marks and print the marks >50.
4. Find the output of the following programs:
a. A list is declared as
marks = [20,15,45,25,30]
What will be the output of
print(3*marks[2] - 4*marks[4])
b. word=['P','R','O','G','R','A','M']
print(word[-4:])
print(word[::-2])
c. word=['P','R','O','G','R','A','M']
print(word.count('R'))
print(word.index('R'))
d. L=[1,2,3]
L*=3
print(L)
e. list1=[10,20]
list2=[30,40]
list1.append(25)
print(list1)
list1.extend(list2)
print(list1)
262 Artificial Intelligence Play (Ver 1.0)-IX

