Professional Documents
Culture Documents
Python Practical - (3, 4)
Python Practical - (3, 4)
Python Practical - (3, 4)
Program:
import string,sys
if sys.version_info[0] < 3 :
input = raw_input
def ispangram(sentence, alphabet = string.ascii_lowercase):
alphabet = set(alphabet)
return alphabet <= set (sentence.lower())
print (ispangram(input('sentence :')))
Outout:-
Aim: 3.b. Take a list, say for example this one: a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] and
write a program that prints out all the elements of the list that are less than 5.
Program:-
name= 'Harsh'
print( name)
list = [1,2,3,4,5,8,13,21,34,55,89]
New_list = []
for i in list:
if i < 5:
New_list.append(i)
print (New_list)
Output:-
Aim: 4.a. Write a program that takes two lists and returns True if they have at least one
common member.
Program:-
#Method – 1
list1 = [1,2,3,4,5]
list2 = [4,5,6,7,8]
for i in list1:
for j in list2:
if i==j:
print('Both the list have the element ',i, 'in ccommon')
Output:-
Aim: 4.b. Write a Python program to print a specified list after removing the 0th, 2nd, 4th and
5th elements.
Program:-
Program:-
list = [21,45,66,7,51,79]
clone = list.copy()
Output:-