# 打印10个abc
p="abc" print(p*10)
# 通过参数传递 print('{greet} from {language}'.format(greet='hello', language='Python')) # 通过位置传参 print('{0} from {1}'.format('hello', 'Python'))
# 转义 # 输出内容因为转义⽽发⽣变化 a = 'C: ew ext.txt' print(a) # 输出内容不带转义 b = r'C: ew ext.txt' print(b)
#练习:有四个数字:1、2、3、4,能组成多少个互不相同且⽆重复数字的三位数? t=[] for i in range(1,5): for j in range(1,5): for k in range(1,5): if (i != j != k !=i ): t.append([i,j,k]) else: pass [print(t1) for t1 in t]