Slip 18 A)
Create a list a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] and write a python
program that prints out all the elements of the list that are less than 5.
Answer :
lst=[1,1,2,3,5,8,13,21,34,55]
cnt=len(lst)
print("Total number of Element in list
is:",cnt)
for i in range(0,cnt):
if
lst[i]<5:
print(lst[i])
Output :
Slip 18 B)
Write a python script to define the class person having members name, address.
Create a subclass called Employee with members staffed salary. Create 'n'
objects of the Employee class and display all the details of the employee.
Answer :
Output :
Savitribai Phule Pune University T.Y.B.B.A.(C.A.) Python Practical Slip 18 Answers
Reviewed by technical_saurabh
on
December 31, 2021
Rating:
No comments:
Post a Comment