python 基本数据类型讲解(3\2)
一:类型
1 不可变数据类型
string,int ,tuple 常量
字符串不可变之再探
string[1] = 'new_one' can?
2 可变数据类型变量
dict list
二 再研究字符串
序列到底是什么
1 三个符合的区别 '',"",""" """
2 偏移量从0开始
3 如何修改字符串之replace,find
三 格式化细究
1 % 格式化方式
2 format格式化方式
3 为什么要用format
4 还有一个方法,字典来了。
四 再议打开文件
标准库的介绍 linecache
#__author__ = 'Administrator'
#coding:utf-8
#1, 0
b = "this is {1} {0} " .format("apple","my")
print b
#形参
b = "this is {whose} {fruit}" .format(whose = "mine",fruit = "apple");
print b
a = "this is %s %s" % ('my','apple')
print a
a = "this is %(whose)s %(fruit)s" % {'whose':'my','fruit':'apple'}
print a