Python Date 1–Hello world print

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

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

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

hello python 2
hello python

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

posted on 2016-11-14 15:28  gxgl314  阅读(369)  评论(0编辑  收藏  举报

导航