首页 > 编程语言 > 详细

python基础

时间:2016-03-05 13:05:08      阅读:152      评论:0      收藏:0      [点我收藏+]
 1 #coding=utf-8
 2 #print函数
 3 print 3, -1, 3.14159, -2.8
 4 #type函数
 5 print type(3), type(3.14159), type("123")
 6 #类型转换
 7 print int(3.14159), int(-2.8)
 8 print float(3), float(-1)
 9 #输出字符串
10 print "span" + "and" + "eggs"
11 str1 = "teacher"
12 str2 = "student"
13 print "I‘m a %s, not a %s"%(str1, str2)
14 s = "123"
15 print type(s) == str
16 #次方
17 print 3 ** 3
18 print 81 ** 0.5

技术分享

python基础

原文:http://www.cnblogs.com/wanderingzj/p/5244451.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!