Question: def print _ list ( lst ) : print ( ' , ' . join ( lst ) ) # 2 def start _ with
def printlistlst:
printjoinlst
#
def startwithcountlst char:
return sum for item in lst if item.startswithchar
#
def doublelistlst:
doubledlist
for car in lst:
doubledlist.extendcar car
return doubledlist
#
def printreversedlst:
reversedlist
for i in rangelenlst:
reversedlist.appendlsti
printreversedlist
#
def rotatelistlst:
rotated lst:lst
return rotated
#
def calavglst:
totallength sumlenitem for item in lst
return totallength lenlst
if namemain:
carlist Chevrolet 'Cadillac', 'Buick', GMC 'Ford', 'Jeep', 'Dodge', 'Tesla', 'Austin'
printHere is the list:
printlistcarlist
printThe number of cars start with C is: startwithcountcarlist, C
printThe list doubled:
printdoublelistcarlist
printThe list reversed:
printreversedcarlist
printThe list after a right rotate:
printrotatelistcarlist
printThe average length of the list items is: f calavgcarlist
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
