2018-04-18 HW

posted Apr 18, 2018, 5:59 AM by Konstantinovich Samuel   [ updated Apr 18, 2018, 7:31 AM ]
Homework:
Complete the simple css tutorials here: 
We will discuss CSS tomorrow.

DO Now:
Open your HTML side by side (text editor / web browser) If you don't have it then just start the rest of the work. DO NOT work on the website now!

Classwork: You are collaborating on a fake quiz! You may use each other, but you may NOT RUN the code

DIRECTIONS:
1. Work with 3-4 of your neighbors. 
2. Do not run the code! Do not run the code!
3. Agree with each of your group for each problem you do. EVERYONE write it down. (include the expression AND answer)
4. Complete one section at a time and compare that ENTIRE section with 2 neighboring groups.
5. Move on to the next section only after 2 other groups agree with you.
--Any group that has an individual that deviates from these directions will not receive credit.-- The entire group will fall if one member falls!
 


By the end of this everyone should have the same answers, and should be convinced that they are correct. 


EVALUATE EACH OF THESE Sections using the definitions:
#starting list and strings
s = "two fish?"
L = ["two","fish?"]
L2 = ["one","fish","two","fishs?"]

#(The actual problems predict the output)
#print "---Section I LEN:---"
print len(s)
print len(L)
print len(L2)

#print "---Section II Indexing:---"
print s[1]
print L[1]
print L2[1]

#print "---Section III Slices:---"
print L2[1:3]
print L2[2:3]
print L2[:2]
print L2[::2]
print L2[1::2]

#print "---Section IV splitting :---"
print "this is a test".split()
print "this is a test".split("s ")

#print "---Section V range:---"
print range(5)
print range(2,5)
print range(2,10,2)

#print "---Section VI in:---"
print "a" in "fish"
print "i" in "fish"
print 5 in [1,2,3]
print 5 in [3,4,5]


#NEW STUFF: Join  
#A string method that takes a list of strings and uses the string to 
#glue the list together (As if it were replacing each of the commas)

#String.join(ListOfStrings) -> a new string
#e.g.
#"x".join(["a","2","b","c"]) results in "ax2xbxc"
#"a b".join(["a","b","c"]) results in "aa bba bc"
#"".join(["a","b","c"]) results in "abc"

#print "---Section VI Join:---"
print "wh".join(["o"," are"," you"])
print "an".join(["b","n","a"])

#VII split and join
print "---SPLIT+JOIN:---"
print "!".join("the only way to go?".split())
print "".join("bannana".split("an"))


Comments