python基础编程
来源:互联网 发布:西电网络信息安全学院 编辑:程序博客网 时间:2024/06/15 09:48
import keyword;print("Hello, World!,hehehe");print "shixinfa"print keyword.kwlist;# print "first"if True: print ("True");else: print ("false");data=input("enter number");print data;num1=100;num2=100.00;name="shixinfa";print num1;print num2;print name;print name[0];print name[1:4]list=['shixincfa','zhangyan','shixiaochun']print list;print list[0];print list[1];shuzu=('shixiaochun','yewen','zhenzidan');print shuzu[0];print shuzu[1:]setdata={'tom','jack','yewen'};print setdata;a=2;b=9;print a+b;print a>b;print a<b;sj1="sxf";if('s' in sj1): print "all in";else: print "not in"listdata=['sss','dfdf','yweru'];print listdata;del listdata[2];print listdata;dict={"name":"sxf","age":22};print dict["name"];print dict["age"];count = 0while count < 5: count = count + 1else: print (count)for i in range(4,9): print i;
list=[2,5,6,7]it=iter(list);for x in it: print x;def hello(): print ("shixinfa"); print ("shixinfa2");hello();def area(width,heigh): return width*heigh;s=area(2,5);print s;a = [66.25, 333, 333, 1, 1234.5]a.append(22);a.remove(333);print a;fo = open("runoob.txt", "wb")print("filename", fo.name)fo.close();try: a=10/0;except OSError as err: print "error";finally: print "all pribt";
阅读全文
0 0
- Python网络编程基础
- Python网络编程基础
- Python 基础编程
- python多线程编程基础
- Python 网络编程基础
- python网络编程基础
- Python编程基础
- Python网络编程基础
- Python基础-TCP编程
- Python基础-UDP编程
- Python编程之基础
- python网络编程基础
- python网络编程基础
- python基础编程
- Python基础-TCP编程
- Python基础 UDP编程
- <python核心编程> python基础
- Python核心编程----Python基础
- python3.x正则表达式的含义及使用
- linux0.11内核完全剖析
- C++关键字
- 共同学习Java源代码-数据结构-Queue
- Could not obtain transaction-synchronized Session for current thread
- python基础编程
- 选择排序
- 程序员修炼(一)----剑指天下
- EffectiveTensorflow:TensorFlow tutorials and best practices
- Hdoj 2671 Can't be easier
- 接口—动物模拟器(猫狗叫)
- 【JZ2440】自我学习记录【0】【准备工作】
- 通达OA系统管理员手册(一)
- 工控机和PLC通信