一、语法结构:
print(输出内容)
print()函数完整的语法格式:
print(value,...., sep= ' ',end=' \n ',file = None)
二、使用方法:
1、
a = 100
b = 50
print(90)
print(a)
print(a*b)
print('hello')
print("hello")
print('''hello''')
print("""hello""")
2、不换行输出, 用逗号隔开
print(a, b, 'hello')
3、
print('b')
print(chr(98))
print('C')
print(chr(67))
print(8)
print(chr(56))
4、
print(ord('北'))
print(ord('京'))
print(chr(21271), chr(20140))
5、数据输出到文件里
fp = open("note.txt", "w")
print("北京欢迎你", file = fp)
fp.close()
三、高级使用
print("北京", "hello", sep='+',)
print('北京', end='--->')
print('hello', end='--->')
print()
print('hello'+'2023')