Fork me on GitHub

Coding Bat Lists/strings/logic/warmup

by Sierra Moore

09 Feb 2014

Screenshots:

Warm-up, strings, logic codingbat

Lists list

Favorite exercises:

String-1 Withoutend

def without_end(str):
  return str[1:-1]

List-1 Has23

def has23(nums):

  if 2 in nums:
    return True 

  if 3 in nums:
    return True

  else: 
    return False

Logic-1 Sorta sum

def sorta_sum(a, b):
 total = a+b
 if total > 9 and total < 20:
   return 20
 else:
   return total
Sierra is a first year MSIS student Find Sierra Moore on Twitter, Github, and on the web.
comments powered by Disqus