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

String & List tracing

What will print out when you run the following functions?


def listIt():
  list = []

  for i in range(1, 11, 2):
    list.append(i)

  string = "cHEcK"
  for index in range(len(string)):
    if string[index].isupper():
      list[index] = string[index]
  
  print "The string is", string
  print "The list is", list

##################################################

def change1():
  source = "Georgia Institute of Technology"
  vowels = "aeiou"
  source = source.lower()
  for letter in vowels:
    loc = source.find(letter)
    if loc <> -1:
      source = source[:loc] + source[loc + 1:]
  print source



Links to this Page