This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: elif score<60: print ("F") s1 = "Franklin and Marshall" s2 = " College" print (s1[:8]) print (s1[8:12]) print (s1[12:21]) print (s1+s2) s = s1 + ''+s2 if "ank" in s: print ('yes') else: print ('no') for i in range (len(s)): print (s[0:i]) print (s.upper()) print (s.lower()) print (s.replace(and, &)) def montePi (numDarts): inCircle = 0 for i in range (numDarts): x=random.random() y=random.random() d = math.sqrt (x**2 + y**2) if d <=1: inCircle = inCircle +1 pi = inCircle/numDarts * 4 return pi...
View Full Document
- Spring '11