deflink1(word):print('')print('')for i inrange(10):print('-',end='')print(word,end='')for i inrange(10):print('-',end='')print('')
link1('print')print('hello',end="\n")print('word',end="\t")print('hello')print('word')
age =19
name ='Tom'
weight =75.5
student_id =2019print('今年我的年龄是%d岁'%age)print('我的名字是%s'%name)print('我的体重是%.2f公斤'%weight)print('我的学号是%06d'%student_id)print('my name is %s, im %.2f years old, my student_id is %d'%(name,age,student_id))print(f'my name is {name}, im {age} years old, my student_id is {student_id}')#格式化符号 %s 字符串, %d 有符号的十进制整数 %f浮点数 folt %.2f表示小数点后保留两位小数list=[10,20,30]print(type(tuple(list)))print(list)
link1('eval转换字符串内的数据为原本的int,tuple(元组),list')
t1='(100,200,300)'print(type(eval(t1)))
link1('复合赋值运算符')print('先算右侧表达式-》复合赋值运算的算术运算-》最后算赋值运算')
b =10
b +=1print(b)
b +=1+3print(b)
link1('比较运算符 == ,!=, > ,< ,>= ,<=')
link1('逻辑运算符 and, or , not')print('and 找要有一个值为0, 则结果为0,否则结果为最后一个非0 数字')print('or 运算符,只有所有制为0 结果才为0,否则结果为第一个非0 数字')
def link1(word): print('') print('') for i in range(10): print('-',end='') print(word,end='') for i in range(10): print('-',end='') print('')link1('print')print('hello',end="\n")print('word',end="\t")print('hel