1.字符串的切片和索引 a[0:5]表示5个元素,第一个到第五个,不是六个。
2.spilt()、replace()、strip()、format()--字符串格式化啊,就像选择题,留空给题者选择
3.函数与控制语句 def 函数名(参数1,参数2...) :
return '结果'
#2018-03-13
#函数格式
'''
def change_number(number):
hide_number=number.replace(number[3:7],'*'*4)
print (hide_number)
change_number('18713577738')
'''
#判断语句
'''
def login():
password = input('password:')
if password=='123456':
print("登录成功")
else:
print('登录错误')
login()
login()
'''
#循环结构
'''
for i in range(1,11):
print(i)
'''
#while循环
'''
i = 0
sum = 0
while i<100:
i = i + 1
sum = sum + i
print(sum)
'''
#数据结构--列表(每一个元素可变,有序,容纳所有对象)
'''
List = ['peter','lilei','wangwu','xiaoming']
ages = [22,23,24,44]
print(List[0])
print(List[2:])
for name,age in zip(List,ages):
print(name,age)
'''
'''
urls = ['www.baidu.we/p{}'.format(number)for number in range(1,13)]
for url in urls:
print(url)
'''
#字典--以键值(key-value)的相识表现出来
'''
user = {
'xiaoming':'45',
'wangwu':'33',
'liqi':'44'
}
print(user)
'''