# s= string 字符串
# d= digital 数字
# f= float 小数点
name = 'molly'
age = 25
friend = 'tony'
city = 'zhengzhou'
credit = 16.6
weight = 10.299
print('我的名字是%s, 我的年龄是%d, 我的朋友是%s, 我的城市是%s, 我的信用是%f, 我的体重是%.2f kg'%(name,age,friend,city,credit,weight))
print(f'我的名字是{name}, 我的年龄是{age}')
print('我的名字是{0},我的年龄是{1}' .format(name, age))
# 转译符 \
print('ABC\nEFG') #换行转译 \n
print(' \' \"') #打印引号
print('c:\\windows\\python') #windows目录与python认知目录的信息节点
print('c:\windows\python')
python 基础
最新推荐文章于 2022-04-19 09:36:03 发布