Class Xi CS - Answer Key
Class Xi CS - Answer Key
Class Xi CS - Answer Key
ANSWER KEY
SECTION A
SECTION D
27.
28.
def linear_search(alist, key):
"""Return index of key in alist. Return -1 if key not present."""
for i in range(len(alist)):
if alist[i] == key:
return i
return -1
alist = input('Enter the list of numbers: ')
alist = alist.split()
alist = [int(x) for x in alist]
key = int(input('The number to search for: '))
index = linear_search(alist, key)
if index < 0:
print('{} was not found.'.format(key))
else:
print('{} was found at index {}.'.format(key, index))
29.
dic = {}
while True :
nam = input("Enter name :-")
per = float(input("Enter percentage :-"))
dic[nam] = per
a = input("Do you want to enter more records enter (Yes/ No)")
if a == "No" or a == "no":
break
30.
print ("The original list is : " + str(test_list))
# printing remove list
print ("The original list is : " + str(remove_list))
# using remove() to perform task
# handled exceptions.
for i in remove_list:
try:
test_list.remove(i)
except ValueError:
pass
# printing result
print ("The list after performing remove operation is : " + str(test_list))
31.
Cybercrime is criminal activity that either targets or uses a computer, a computer network or a
networked device.
Types of cybercrime
1. Email and internet fraud.
2. Identity fraud (where personal information is stolen and used).
3. Theft of financial or card payment data.
4. Theft and sale of corporate data.
5. Cyberextortion (demanding money to prevent a threatened attack).
6. Ransomware attacks (a type of cyberextortion).