Posted by: Sourav | December 28, 2016

Class 11 Python assignment solved,Python teacher Sourav,Kolkata 09748184075


answer=’yes’
L=[]
while answer==’yes’:

answer=(raw_input(“Do you like to insert value in the list,yes/no”))
if answer.lower()==’no’:
#print ‘answer is ‘,answer
break
#print answer
L.append(int(input(‘Please enter a number for the list’)))
answer.strip()
answer.lower()

print L

i=0
while (i<len(L)):

if ((L[i]%2)==0):
L.append(2)

for j in range(len(L)-2,i-1,-1):
L[j+1]=L[j]
print L ,’j is = ‘,j

L[i]=2
print L ,’i is = ‘,i
i=i+2
else:
i=i+1

print L

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: