Pythonprint

 1 # 输出数字
 2 print(520)
 3 print(13.14)
 4 
 5 # 输出字符串
 6 print('helloworld')
 7 print("helloworld")
 8 
 9 # 输出含有运算符的表达式
10 print(1 + 2)
11 print(2 * (1 + 2))
12 
13 # 将数据输出到文件中
14 # PS:1.所指定的盘符存在
15 #    2.使用file=
16 # a+:如果文件不存在就创建,存在就在文件内容的后面追加
17 fp = open('E:/text.txt', 'a+')
18 print('helloworld', file=fp)
19 fp.close()
20 
21 # 不进行换行输出
22 print('hello', 'world', 'python')
原文地址:https://www.cnblogs.com/0xiaoyu/p/15772431.html