June+15th+2016+by+Doris

** Learning outcomes -- Edited by Doris Xue on June 15th. **
toc


 * One of the resources is python documentation, if you want to find more information about python such, just click the link so that you can find the introduction on python official website.**

Some basic using about turtle mentioned in class:

turtle.dot/turtle.stamp

turtle.dot(size,color), if there is not variable

turtle.speed(0)fastest is 0, plot the graph immediately

turtle.pos,print the position of turtle

Three groups about extra using about turtle:

Using events of turtle: onelickand etc.

Using screen events

Animation control

How to find modules in official python website:

python -> modules (to find modules you need such as math, turtle matplotlib, numpy, scipy(After import, python can be used as matlab)

2.How to change the size and color of codes in PyCharm:

 * setting -> editor -> colors and fonts -> font**

1.INPUT
input input(‘please’) -> a (variable) a = input(‘please’)

2.OUTPUT
print example: print list (0,varible) in one line first method:

code format="python" for i in range (0,11): print(i,end = ‘,’)  #every i in for iteration is end with the character inside ' ' code second method: code format="python" a = int(input(‘up-limit:’)) b = ‘’ for i in range(0,a+1) b = str(a)+b print b   #turn int into str code third method: code a=int(input) b=[ ] for i in range(0.a+1) b.append(i) print b   #print a list code

3.SELECTION
Example:power school model: Justify the level of user’s grade using selection 90-100 A* 80-90 A 70-89 B 60-79 C <60 D code format="python" while 1: a = int(input('grade:')) if a >= 0 and grade <= 100: break
 * if :**
 * #when condition is ture**
 * elif :**
 * #elif==else: -> if**
 * else:**

if a >= 90: print('A*') elif a >= 80: print('A') elif a >= 70: print('B') elif a >= 60: print('C') else : print('U') code

1.for
for i in range(a,b)/list[a,b] Every iteration of i, i equal to next variable 2.while : Every integration of i, programmer must change the variable 3.while 1: if : break

4.Homework:
How to think like a computer scientist chapter 3 : end of chapter

Have Fun !