strings (字符串型): using 单引号 '' or 双引号  ""

a = 'abc'   or a = "a"

b = 'def'

适用于字符串型操作: 1. 乘   3*a = 'abcabc'

2.加   a+b = 'abcdef'

3. 求长度  len(a) = 3 

4.index  检索  a[2] = 'c' 

5.slice 切片 a[1:] = 'bc'     


input函数 :  无论你输入什么 都是以字符串的形式 存储

如果想要 特定的  就必须  int(input())  这样子。


循环 :

1.   while  

2.    for

MIT 6.001X 2016 (2)core elelments of programs

MIT 6.001X 2016 (2)core elelments of programs

相关文章: