!/usr/bin/python

-- coding: UTF-8 --

this is about lists

list1 =[‘python’,’java’,’android’,’sql’] #define a lists
list2 =[‘python’,’java’,’android’,’sql’] #define another lists
print list1[0]
a= cmp(list1,list2)
print a
list1.insert(1,’c++’) #insert a new list in the lists
print list1
list1.append(‘c’) #insert a new list in the last of the lists
print list1
list1.reverse() #reverse the lists
print list1
list1.extend(list2) #extend a new lists into the list
print list1

this is about tup

tup1 = (‘pychsics’,’chemistry’,1997,2000) #define the frist tup
tup2 =(1,2,3,4,5) #define the twice tup
print “tup1[0]:”,tup1[0] #printout the tup1[0]
print “tup2[1:5]:”,tup2[0:4] #print out the tup2[1-5]
tup3 =tup1+tup2
print tup3 #you can connect the tup1 and tup2 but you can’t alter them
del tup1 #delete tup1
print tup2*3
print 3 in tup2 #output a boolen if number in the tup or not
for x in tup2:
print x

this is about dictionary

dict1 = {‘name’:’qianbingbing’,’age’:24,’tel’:12343554}
print dict1[‘name’]
print dict1[‘age’]
print dict1[‘tel’]
del dict1[‘name’]
print dict1
dict1.clear()
print dict1
del dict1
dict2 = {‘name’:’qianbingbing’,’age’:24,’tel’:12343554}
print len(dict2)

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android经久不衰最受欢迎的开源库整理,你
  2. Xposed框架之函数Hook学习
  3. Android(安卓)Studio Error:前言中不允许
  4. android软键盘的显示后隐藏
  5. 浅谈Android五大布局
  6. android cmd adb命令安装和删除apk应用
  7. Android(安卓)关于EditText文字的显示问
  8. Android(安卓)进程保活
  9. Android(安卓)Studio 2.2 NDK开发环境搭
  10. android Canvas用法