Posted by: Sourav | December 28, 2016

Second class 11 python assignment solved,Python Teacher Sourav,Kolkata 09748184075


L=[2,5,8,15,3,1222,887,100,34,567,1]
maxnum=L[0]
minnum=L[0]
for i in range(0,len(L)):
if maxnum>=L[i]:
pass

else:
maxnum=L[i]
if    minnum>=L[i]:
minnum=L[i]
else:
pass

print ‘maxnum is = ‘,maxnum
print ‘minnum is = ‘,minnum
print ‘product of maxnum and minnum is ‘,float(maxnum*minnum)

sumofothernums=0
for i in range(0,len(L)):
if ((L[i]!=maxnum) or (L[i]!=minnum)):
sumofothernums+=L[i]
print ‘sum of other numbers is ‘,float(sumofothernums)

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: