|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 872370398 于 2017-6-19 21:42 编辑
10 "Good example:
>>> myteacher = '小甲鱼'
>>> yourteacher = myteacher-------(2)
>>> myteacher = '黑夜'
>>> print(yourteacher)
Result is 小甲鱼. It means when doing Line 2, your teacher is give the string directly rather than linked to my teacher"
11 When need to use module, we should import module first. E.g Import Random.
for functions in the module, it writes as c=random.int(1,10)
12 5e15=5*10^15
About data type
type(5e15)=> <class 'float'>
isinstance(5e15,float)=> True
13 for target/element in expression/list
Loop part
A String can be seen as collection of alphabets
14 Range, generate a list include the first para not the end para
for I in range(5)=>[0,4]
for I in range(2,9)=>2~8
for I in range (1,10, 2)
the third para is the step
15 Break in loop body
stop execution and jump out of loop (even while criteria is still true)
16 Continue
Stop the current executing the remaining lines in this current loop and jump to next round of loop (need to test criteria again)
|
|