Cs 1
Cs 1
2 What should be the data type for the column IFSC_Code storing alphanumeric bank 1
branch code have 11 characters, eg., INBK0088200 ?
5 _____ is a non-key attribute, whose values are derived from the primary key of some 1
other table.
1
7 What will be the output for the following python statements ? 1
8 Consider the statements given below and then choose the correct output from the given 1
options:
pride="#G20 2023INDIA"
print(pride[-2:2:-3])
a) II00 b) AN32 c) D320 d) 20GA
9 Which of the following statement(s) would give an error after executing the following 1
code?
print(9/2) # Statement-1
print(9//2) # Statement-2
print(9%%2) # Statement-3
print(9%2) # Statement-4
a) Statement-1 b) Statement-2 c) Statement-3 d) Statement-4
10 Which of the following random module functions generated a floating point number? 1
a) random() b) randint() c) uniform() d) all of these
13 An unexpected event that occurs during runtime and causes program disruption, is called:
a) Compile time error b) Logical error c) Runtime error d) Exception
2
(d) A is false but R is True
17 Assertion(A): A data structure that contains the value sequentially or linearly is known as
linear data structure.
Reasoning(R): Lists and tuples are linear data structures
18 Assertion(A): The tell method will stores / get the current location of the file pointer.
Reasoning(R): Python seek method returns the current position of the file read / write
pointer within the file.
SECTION – B
19 Define web browser and web server 2
(OR)
What is the difference between Packet switching and circuit switching techniques?
20 Anita has written a code to input a number and check whether it is prime or not. His code 2
is having errors. Rewrite the correct code and underline the corrections made.
def prime():
n=int(input("Enter number to check :: ")
for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n")
break
else:
print("Number is prime \n’)
prime()
21 i) 2
Given is a Python string declaration:
myexam="ComputerScience"
Write the output of :
print(myexam[-2:2:-2])
(OR)
dictcount={'age1':26,'age2':32,'age3':40}
sum=0
for key in dictcount:
sum=sum+dictcount[key]
print(sum)
23 Write a suitable Python statement for each of the following tasks using built-in 2
functions/methods only:
i) To delete an element Chennai : 06 from Dictionary DICT.
ii) To display words in a string S in the form of a list.
(OR)
(OR)
Write the difference between PRIMARY KEY and UNIQUE KEY in SQL.
p=8
def sum(q,r=5):
global p
p=(r+q)**2
print(p, end= '#')
a=2; b=5;
sum(b,a)
sum(r=3,q=2)
SECTION - C
26 Predict the Output of the Python code given below: 3
s='welcome2cs'
n=len(s)
m=''
for i in range(0,n):
if(s[i]>'a' and s[i]<='m'):
m=m+s[i].upper()
elif(s[i]>='n' and s[i] <= 'z'):
m=m+s[i-1]
elif(s[i].isupper()):
m=m+s[i].lower()
else:
m=m+'&'
print(m)
27 Monika is a senior clerk in a MNC. She created a table ‘Salary’ with a set of records to 3
keep ready for tax calculation. After creation of the table, she has entered data of 5
4
employees in the table.
28 A text file “PYTHON.TXT” contains alphanumeric text. Write a program that reads this 3
text file and writes to another file “PYTHON1.TXT” entire file except the numbers or
digits in the file.
(OR)
A pre-existing text file data.txt has some words written in it. Write a python function
displaywords( ) that will print all the words that are having length greater than 3.
If the contents of file is :
A man always wants to strive higher in his life
He wants to be perfect.
The output should be: always wants strive higher life wants perfect.
(b)Table : Employee
5
(ii) Select JobId, count(*) from Employee group by JobId;
30 Thushar received a message(string) that has upper case and lower case 3
alphabet. He want to extract all the upper case letters separately .Help him to do
his task by performing the following user defined function in Python:
SECTION – D
31 Consider the table PRODUCT and CLIENT given below: 4
Initially student total field is empty string as example data is given below
['1', 'Anil', '40', '34', '90', '']
['2', 'Sohan', '78', '34', '90', '']
['3', 'Kamal', '40', '45', '9', '']
A another file “final.csv” is created which reads records of “result.csv” and copy all
records after calculating total of marks into final.csv. The contents of final.csv
should be
['1', 'Anil', '40', '34', '90', '164']
['2', 'Sohan', '78', '34', '90', '202']
6
['3', 'Kamal', '40', '45', '9', '94']
(a) Define a function createcsv() that will create the result.csv file with the
sample data given above.
(b) Define a function copycsv() that reads the result.csv and copy the same
data after calculating total field into final.csv file.
SECTION – E
33 India Tech Solutions (ITS) is a professional 5
consultancy company. The company is planning
to set up their new offices in India with its hub at Hyderabad. As a network adviser, you
have
to understand their requirement and suggest them the best available solutions. Their
queries
are mentioned as (i) to
(v) below.
(i)Which will be the most appropriate block, where TTC should plan to install their
server?
(ii) Draw a block to block cable layout to connect all the buildings in the most appropriate
manner for efficient communication.
(iii)What will be the best possible connectivity out of the following, you will suggest to
connect the new set up of offices in Bangalore with its London based office.
• Satellite Link
• Infrared
• Ethernet
(iv)Which of the following device will be suggested by you to connect each computer in
each
of the buildings?
• l Switch
• l Modem
• l Gateway
7
(v) Company is planning to connect its offices in Hyderabad which is less than 1 km.
Which type of network will be formed?
(OR)
35 (i) Define the term constraint with respect to RDBMS. Give a suitable example. 5
(ii) Virat has created a table named TRAVELS in MySQL:
Tour_ID – string
Destination – String
Geo_Cond– String
Distance – integer (In KM)
Note the following to establish connectivity between Python and MYSQL:
Username is root
Password is bharat
The table TRAVELS exists in a MYSQL database named TOUR.
The details Tour_ID, Destination, Geo_Cond and Distance are to be accepted
from the user.
Virat wants to display All Records of TRAVELS relation whose Geographical condition
is hilly area and distance less than 1000 KM. Help Virat to write program in python.
(OR)
i) Mr. Sandeep created two tables with DEPTNO as Primary key in Table1 and Foreign
key in Table2. While inserting a row in Table2, Mr. Sandeep is not able to enter a value
in the column DEPTNO. What could be the possible reason for it?
ii)
Consider the following table structure
Table : Faculty
Faculty F_ID(P)
Fname
Lname
Hire_date
Salary
Write the Python code to create the above table.
Consider :
host : localhost
UserName : root
Password : system
Database : School