摘要: #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Python 字符串 var1 = '天天向上' var2 = 'Hello World' #01 python 访问字符串中的值 print("var1[0]: ",var1[0]) print("var2[2:5]: ",var2[2:5]) #02 Python 字符串更新 print(... 阅读全文
posted @ 2017-09-29 18:01 hayden__wang 阅读(172) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python3 # -*- coding: utf-8 -*- #Python 元组 #01 定义一个元组 tup1 = ('张飞','赵云','刘备','关羽') tup2 = (1,2,3,4,5) tup3 ="a","b","c","d" tup4 = () tup5 = ('single',) #因为括号()既可以表示tuple,又可以表示数学公式中的... 阅读全文
posted @ 2017-09-29 14:31 hayden__wang 阅读(141) 评论(0) 推荐(0) 编辑