Professional Documents
Culture Documents
Python - Fix The Error QP
Python - Fix The Error QP
1) Identify 2 errors
if 5 > 2
2) Identify 3 errors
x-z = 5
2y = "John
print(type(y))
3)Identify 1 error.
x, y, z= "green","yellow"
print(x)
print(y)
print(z)
p = string(5)
print(type(p))
x = 58
y = 10
a=x+y
print(a)
for x in range(1, 6)
print(x)
LOGICAL TEST – IDENTIFY THE ERRORS AND FIX THEM
a= "Hello my FRIENDS"
x = a.lowr()
print(x)
8)Change the following code , such that the output will be John#Peter#Vicky
x = " ".join(a)
print(x)
9) ) Identify 1 error. (Program to count the number of times apples appear in the statement)
x = a.count("apples)
print(x)
10) ) Identify 1 error. ( Program to print numbers from 1 to 5 using while loop.)
i=1
while i < 6:
print(i)
i = i + 1: