摘要: 1.加法: s1 = "hap" s2 = "py" s = s1+s2 print(s) >happy 2.乘法 s1 = "happy" s = s1*3 print(s) >happyhappyhappy 3.字符串可用单引号、双引号、三引号 阅读全文
posted @ 2018-11-28 16:37 醉墨寒香 阅读(531) 评论(0) 推荐(0)
摘要: 1.if...else语句 格式1: if 条件: 语句1 else: 语句2 格式2(嵌套):可嵌套多个if...else语句 if 条件: if 条件: 语句1 else: 语句2 else: 语句3 2.if...elif...else语句 if 条件: 语句1 elif 条件: 语句2 .. 阅读全文
posted @ 2018-11-28 16:18 醉墨寒香 阅读(1774) 评论(1) 推荐(0)
摘要: 前提条件:python版本3.5.1,Eclipse SDK版本 3.5.0 ecilpse编辑器默认编码为gbk,所以需要调整ecilpse编码格式为utf-8才可以实现python语言中文的输入输出 设置步骤: 1.点击Window-preferences(若ecilpse为中文版本,则为“窗口 阅读全文
posted @ 2018-11-28 16:04 醉墨寒香 阅读(323) 评论(0) 推荐(0)