Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

List Practice B

#Fill in the lines to the right with the output that will be generated by this function
def accLists():
  alist = ['BC', 'Clemson', 'Duke', 'FSU', 'Georgia Tech', 'Maryland']
  clist = ['UofM', 'UNC', 'NC State', 'UVA', 'Virginia Tech', 'Wake Forest']

  print alist                                                              #_______________________________
  print alist[0]                                                           #_______________________________
  print alist[3:5]                                                         #_______________________________
  print alist[3:]                                                          #_______________________________
  print alist[:3]                                                          #_______________________________
  print alist[-1:]                                                         #_______________________________
  print alist[:-1]                                                         #_______________________________
  print alist + clist                                                      #_______________________________
  print clist[3:5] + alist[3:5]                                            #_______________________________
  print clist[5:3:-1] + alist[ len(alist)-1:0:-2]                          #_______________________________
  print alist                                                              #_______________________________
  print clist                                                              #_______________________________
  clist.remove('Wake Forest')                                              #_______________________________
  print clist                                                              #_______________________________
  clist.sort()                                                             #_______________________________
  print clist                                                              #_______________________________
  alist.sort()                                                             #_______________________________
  alist.reverse()                                                          #_______________________________
  print alist                                                              #_______________________________
  newlist = clist + alist                                                  #_______________________________
  newlist.sort()                                                           #_______________________________
  print newlist                                                            #_______________________________
  print newlist.count('NC')                                                #_______________________________
  print newlist.count('GeorgiaTech')                                       #_______________________________
  print newlist.count('Georgia Tech')                                      #_______________________________
  print newlist.count('Georgia Tech') + alist.count('Georgia Tech')        #_______________________________
  print max(newlist)                                                       #_______________________________
  print min(newlist)                                                       #_______________________________


Links to this Page