Q21. Write the output of the following :
a = 7
for i in 7:
print(a)
Q22. Write the output of the following code :
a = "AMIT"
for i in range(len(a)):
print(a)
Q23. Write the output of the following code :
x = "Welcome to my blog"
j = "i"
while j in x:
print(j)
Q24. Write the output of the following code :
Q25. Write the output of the following code :
for i in range(0,2,-1):
print("Hello")
Q26. Write the output of the following code :
s1="csiplearninghub.com"
s2=""
s3=""
for x in s1:
if(x=="s" or x=="n" or x=="p"):
s2+=x
print(s2,end=" ")
print(s3)
Q27. Write the output of the following code :
s1="csiplearninghub.com"
c=0
for x in s1:
if(x!="l"):
c=c+1
print(c)
Q28. Write the output of the following code :
j=12
c=9
while(j):
if(j>5):
c=c+j-2
j=j-1
else:
break
print(j, c)
Q29. Write the output of the following code :
L = [13 , 12 , 21 , 16 , 35 , 7, 4]
sum = 5
sum1 = 3
for i in L:
if (i % 4 == 0):
sum = sum + i
continue
if (i % 7 == 0):
sum1 = sum1 + i
print(sum , end=" ")
print(sum1)
Q30. Write the output of the following code :
print('cs' + 'ip' if '234'.isdigit() else 'IT' + '-402')