September+12th+2016+by+Charles+Han

1 How to read the strings/integers in the list.

This is the basic code. type(i)==list is one way which is really strong to help us make judgement code format="python" def find(n): for i in n:

if type(i)==list or type(i)==tuple:

find(i) else: print(i) find(["b",["asdf",["c",[(1,2,3)]]]])

code We can do more on this code, we can print out every letters in string which also use type(i)==str: code format="python" def find(n): for i in n:

if type(i)==list or type(i)==tuple:

find(i) else: if type(i)==str: for n in i:                   print(n)

else: print(i) find(["b",["asdf",["c",[(1,2,3)]]]])

code 2.chapter 10 After we learn chapter 10, we know some basic of user alternation that our program can respond to events. In this chapter we learnt three events: First, keypress events. Second,mouse events. Third, Automatic events.

1 wn: wn is the window net it means at any where of the window can trigger the event. The place of "wn"In keypress events and mouse events it tells where our action will be response. For example, we can change it to let only click at the cusp can trigger the events.

2 onclock For onclock there is no need to provide the location of mouse but it will automatically run the program. It can only run once or using recursion to repeat.

3 global Global is define at the outer space so that every functions can use it. All functions can operate it at the same time. It not like local value only exist in one function.

code format="python" totalvalue1 = 0 def increment(interval): global totalvalue1 totalvalue1 += interval def decrement(interval): global totalvalue1 totalvalue1 -= interval for i in range(100): increment(2) decrement(100) print(totalvalue1)

totalvalue2 = 0 def increment(interval): totalvalue2 = 0 totalvalue2 += interval def decrement(interval): global totalvalue2 totalvalue2 -= interval for i in range(100): increment(2) decrement(100) print(totalvalue2)

code The first one global the totalvalue for both functions so both of them can change it. So what we got is100.The second one os different that actually the total value in two functions is deferent, they only have the same name. So what we got is -100