Python Date 1–Hello world print

对比学习Python与C
str1 = 'hello python 2'
# 字符串
i = 3.1415926535

print(str1)
print("hello python ")
# print 自带换行符
print('%s'%str1)
print(str1)
print("你好,%s OK %d" % (str1, i))
##格式化打印到标准输出

print("%.2f %.4f" % (i, i))
 
输出:

hello python 2
hello python

hello python 2
hello python 2
你好,hello python 2 OK 3
3.14    3.1416

原文地址:https://www.cnblogs.com/gxgl314/p/6062072.html