Professional Documents
Culture Documents
ANNUAL EXAMINATION
2020 - 2021
PCT-1
Section A [2x6=12]
1. Why Python is called object oriented programming language?
2. What do you mean by operator? Discuss Relational operator with example.
3. What is the syntax of for loop? Show with an example.
4. What is the difference between break and continue?
5. What is literal in python? Give example.
6. Rewrite the code using while loop
for i in range(1,n-1):
for j in range(1,n-i-1):
print(i)
print(j)
[1x4=4]
7. Find out error.
(x , y, z) = (12, 3):
k=z;
1
print(k)
8. Output of 14.0 **4 is
9. What do you mean by binary operator? Give examples.
10. Write down the names of different modes in python?
11. Write a program to check that two numbers are twin primes or not? [4 x2=8] Twin
prime means both the given numbers are prime and their difference is 2. For example
11 and 13 are twin primes but 11 and 17 or 13 and 15 are not twin primes.
12. Write a program to find out the sum of the series:
S=1-1/3+1/5-1/7+…. Upto nth term
[1x4=4]
13. What do you mean by string slice in Python?
14. What is the purpose of using append function in a list.
15. Write down any two features of Dictionary.
16. Define the mutability feature in python.
[2x6=12]
17. Predict the output
21. Replace for loop with while loop for the following code:
n=int(input(“Enter the limit:”))
s=0
for i in range(n+1,0,-2):
s=s*i
i=i+1
print(“The sum is”,s)
2
22. Find out the errors in the following code segment:
for a in range (15,25);
k=0:
for I in range (2,a//2+1):
If (a % i=0):
k=k+1
If(k==0)
print(“number is prime”)
else:
print(“not prime”)
23. Write a program which will take your name as an input and print your name as
below: [5] Input : Avijit Roy Das
Output: A.R.Das
3
[2*3=6]
38. Posing as someone else online and using his/her personal/financial information,
shopping online something is a common type of cyber crime these days . [1+2+2=5]
c) Give example of some software, hardware that may be used for special needs students.