Computer ScienceA1 MID TERM 2022 23 QP
Computer ScienceA1 MID TERM 2022 23 QP
General Instructions:
Q3. Consider the declaration L = '3.14+20j'. What will be the data type of L? (1)
a) List b) tuple c) dictionary d) String
Q4. Which of the following symbols is used in python for single line comment? (1)
a) / b) /* c) // d) #
1
Q9. There are ……………. types of strings supported in Python (1)
a) Two
b) Three
c) one
d) All of the above
Q11. How does the computer understand a program written in high level language? (2)
Q12. What is the need for RAM? How does it differ from ROM? (2)
Q13 Name the software required to make a computer functional. Write down its two primary
services. (2)
Q14. Differentiate between proprietary software and freeware software. Name two software for
each type. (2)
Q16 a) Derive a Boolean expression for the output F for the logic circuit given shown below :
(2x2=4)
i)
2
ii)
ii) (X+Y).(X+Z)
Q17. What is the difference between interactive mode and script mode in Python? (2)
Q19. What do you mean by data types? What are Python’s built-in core data types? (2)
Q20. What is the difference between implicit and explicit conversion? (2)
Q21. What are string literals? How many types of string literals are there? (2)
Q22. A school conducts 3 weekly tests of 30 marks each and a term exam of 100 marks. To
calculate the aggregate percentage of marks obtained by a student, calculations are done as
follows:
Aggregate Percentage = (weekly test total)/3+70% of term exam.
Write a Python script to calculate and display the aggregate percentage of a student after
taking the marks of the student in the three weekly tests and the term exam. (3)
Q23. Write a program to enter a number and print whether the number is positive, negative or
zero. (3)
Q26. Identify errors in the following code and rewrite the code by underlining the corrections.
(3x2=6)
a) A=B=12/5
if A!=b
print"Not equal"
else print"Equal"
c) x = input(“Enter value”)
for k in range[0,20]
Print(x+k)
a) year=2000 (1)
if year%100!=0 and year%4==0 or year%400==0:
print("Lp")
else:
print("Not Lp")
c) x=5 (2)
for k in range(0,10) :
if x==k:
print(x+k)
else:
print(x-k)
e) x=6 (2)
for i in range(x):
if x==5:
break
print("H")
print(x)