XII CS HYD MS PB1
XII CS HYD MS PB1
(OR)
a. Write one advantage and one disadvantage of guided
over unguided communication media.
Advantage : By adding more wires, the transmission
capacity can be increased in guided media.
Disadvantage:
It cannot pass through walls and cannot travel long
distance
Corrections :
def EOcount(L):
evensum=oddsum=0
for i in range(0,len(L)):
if L[i]%2==0:
evensum+=1
else:
oddsum+=1
print(evensum, oddsum)
½ mark for each correction made
21 Write a function Show_sal(EMP) in python that takes the 2
dictionary, EMP as an argument. Display the salary if it is
less than 25000
Consider the following dictionary
EMP={1:18000,2:25000,3:28000:4:15000}
The output should be:
18000
15000
Solution:
EMP={1:18000,2:25000,3:35000,4:15000}
def Show_Sal(EMP):
for sal in EMP.values():
if sal<25000:
print(sal)
Show_Sal(EMP)
½ mark for
correct function header
½ mark for
correct loop
½ mark for
correct if statement
½ mark for
displaying the output
(OR)
Write a function, VowelWords(Str), that takes a string as an
argument and returns a tuple containing each word which
starts with an vowel from the given string
For example, if the string is "An apple a day keeps the
doctor away”, the tuple will have (“An”,”apple”,”a”, “away”)
Solution:
Str=”An apple a day keeps doctor away”
Tup=( )
def VowelWords(Str):
words=Str.split()
if words[0] in “aeiouAEIOU”:
Tup=Tup+(word,)
return Tup
T=VowelWords(Str)
print(“The Vowel Word Tuple is”, T)
(OR)
A list named stu_marks stores marks of students of a
class. Write the Python command to import the required
module and display the average of the marks in the list.
Solution:
import statistics
stu_marks =[45,60,70,85,40]
print(statistics.mean(stu_marks))
sports
SOCCER
TENNIS
CRICKET
ATHLETICS
ii.
sports SUM(salary)
SOCCER 50000
TENNIS 25000
ATHLETICS 20000
iii.
pname sports salary
VIRAT CRICKET 15000
NEERAJ ATHLETIC 12000
S
SANIA TENNIS 5000
def displaywords():
file=open(“Rhyme.txt”,”r”)
lst=file.readlines()
for i in lst:
word=i.split()
for j in word:
if len(j)>5:
print(j)
file.close()
displaywords()
countrec=0
def COUNTR():
f=open(“record.csv”,’r’)
data=csv.reader(f)
d=list(data)
print(“ the no. of records in a file”,len(d))
f.close()
½ mark for
opening and closing file
½ mark for
reader object
½ mark for
calculating length
½ mark for
returning or printing no. of records
SECTION E
33 A company SUN Enterprises has four blocks of buildings as 1*5=5
shown:
i. Star/Bus topology
ii. repeaters are required as the distance between B3-B2
and B3-B4 is exceeding 100M
iii. Switch/Hub
iv. Any unguided media suitable for hilly areas
v. B1 block as it has more number of computers