Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Optional arguments

Name: Anonymous 2011-07-27 6:13


def find(str, ch, start=0):
  index = start
  while index < len(str):
    if str[index] == ch:
      return index
    index = index + 1
  return -1


Add a fourth parameter, end, that specifies where to stop looking. The default value of end should be len(str).

Name: Anonymous 2011-07-27 6:24

What about keywords? Like (draw-circle O R :filled T :color +RED+) Can Python do keywords?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List