0% found this document useful (0 votes)
282 views2 pages

Output and Error Questions

Output error class 11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
282 views2 pages

Output and Error Questions

Output error class 11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Write the output of the following program

1. T="SaVE EArtH"
i=0
while i<len(T)-1 :
if T[i] in 'AE' :
print("#")
elif T[i].islower() :
print(T[i].upper())
else:
print('@')
i+=1

2. k= -10
for i in range(50,30,k):
k -=2
print( i , k , sep=" ")

3. number, result , digit = 572 , 0 , 0


while number ! = 0 :
result *=10
digit = number%10
result + = digit
number // = 10
print( “output = ” , result )

4. A=10
if A+5==15:
print (‘@@@’)
print(A*5)
elif A>=100:
print(A//-10.0)
else:
print(A**2)
print (“Good attempt”)
Find errors and write the correct statement (Underline both errors and
corrections done):

1. for I IN range([Link]-2)
print(“the value is “ I )

2. A==Int (input ())


if A = 10;
Print (‘Welcome’)
else
A =*5
A + 10 = B
3. Num = input(“Enter a number:”)
Result = num*2
Print(result)
4. x = int(“Enter value for x”)
for in range[0,11]:
if x = y
print x + y
else:
print x-y

You might also like