Table of Content:
- Python Error Finding Questions – Test 1
- Python Error Finding Questions – Test 2
- Python Error Finding Questions – Test 3
Python Error Finding Questions – Test 1
Q1. Find error(s) in the following code(if any) and rewrite code and underline each correction:
x= int(“Enter value of x:”)
for in range [0,10]:
if x=y
print("They are equal")
else:
Print( "They are unequal")
Q2. Find error(s) in the following code(if any) and rewrite code and underline each correction.
a, b = 0
if (a = b)
a +b = c
print( z)
Q3. Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.
A = int(input("Enter any number:"))
Ar = 0
for x in range(0,A,2)
Ar+=x
if x%2=0:
Print (x*10)
Else:
print (C)
print (Ar)
Q4. Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.
fee=250
0 = i
while fee=<2000:
if fee<=750:
print (fee)
fee =+ 250
else:
print( "fee"*i)
i=i+1
fee=Fee+250
Q5. Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.
10 = step
for e in the range(0 , step):
If e%2==0:
print(e + 1)
else:
print(e - 1
Python Error Finding Questions – Test 2
Q6. Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.
str = "Welcome to my Blog
for S in range[3,9]
Print (str(S))
Q7. Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.
For i in Range(10):
if(i==5)
break:
else:
print(i)
continue
Q8. Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.
a = input("Enter any number")
if a%2=0:
print("Even number)
Else
print("Odd number")
Q9. Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.
a = int(Input("Enter any number"))
b = int(input("Enter any number"))
if a=>b:
print("First number is greater"))
else:
Print("Second number is greater")
Q10. Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.
a = int{input("Enter any number")}
for i IN range(1:11):
print(a," * " , i , " = ", a*i)
Python Error Finding Questions – Test 3
Q11. Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code
def sum(c)
s = 0
for i in Range(1, c+1)
s=s+i
return s
print(sum(5)
Q12. Rectify the errors in the following statements:
1. Print("Anuj")
2. For i in range(2,4):
3. for i in Range(3,9):
4. def title( )
5. if i =< 5
Q13. Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code
N=int(input("Enter any Number:"))
S = 0
for i in range(1,N,2)
s += 1
if i%2=0:
print("i" * 2)
else:
print("i" * 3)
print[S]
Q14. Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.
L = [1,2,3,4,5,6,7,'a','e'
for i in L:
if i==a
break:
else:
print("A")
Q15. Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code.
a = {'6' : "Amit", '2' : "Sunil" : '3' : "Naina"}
for i in a:
if int(i)%3=0
print(a(i))
Class 12 Computer Science Sample Paper 2020-2021.
Class 12 Computer Science Sample Paper Marking Scheme
Class 12 Computer Science Test Series