python 掌握之路(一)
来源:互联网 发布:站长 疯狗软件 编辑:程序博客网 时间:2024/05/03 09:14
#!/usr/bin/env python# -*- coding: utf-8 -*-# use case 1: the first python programprint "hello world";# use case 2: the second python program : use keyword :forfor i in range(10): print str(i)+"hello worldww";print "add";# use case 3: the second python program : use keyword for (2. write mult lines)for i in range(10): print str(i)+"hello worldww"; print "add";# use case 4: multLine annotation'''print "multline ";'''#use case 5: pint a string of stringprint "hello world " , "secod string " ,"third string ";#use case 6 : print calulateprint '3+5 =' , 3+5 ;#use case 7: input a string'''name = raw_input();print 'the name is value :',name ;#use case 8: input a string with informationname = raw_input('please input a name');print 'the name is value :',name ;'''#use case 9: print absolute value of a integer (use the key word of if )a=100if a>=0: print a;else: print -a;#use case 10: print ' or ""print '\"i\'m enjoy pthon \"';#use case 11 : use +x = 100;x = x+300;print x;x ="a string";print x;#use case 12: about int and floatprint 10/3;print 10.0/3;print 10%3;print 10.0%3;#use case 13: out of range of variableb ='B';b = 65574; # haven't out of range . good !b = 898888888;print b ;#use case 14: ACSII code ,UNICODE'''#!/usr/bin/env python# -*- coding: utf-8 -*-'''print ord('T'),chr(100) , unicode('T'), len('hello'),len(unicode('hello')),len(unicode("你好".decode('utf-8'))) , "你好";#use case 15 , connect stringprint "the nuber i want to enter is %d , the name of mine is %s"%(7 , "liujie");
0 0
- python 掌握之路(一)
- python 掌握之路(二)
- Python之路(一)
- 通往python之路(一)
- python(学习之路一)
- Python学习之路(一)
- Python学习之路一--(基础知识)
- Python学习之路(一)
- Python 学习之路(一)
- Python学习之路(一)
- Python探索之路(一)---简介
- 学习python之路---python小算法总结(一)
- 菜鸟python教程,菜鸟的python之路(一)
- Python之路【第二篇】:Python基础(一)
- FireFly开发之路(一)python学习一
- 深入掌握JMS(一)
- Python学习之路【一】
- python学习之路一
- LibSVM使用方法
- Struts2文件下载
- ajax传回的json对象要用javascript中的eval()函数处理的原因
- MVC模型及架构
- 高效ARM C编程(中)
- python 掌握之路(一)
- 提高篇 第12节-变量的存储类别
- 在iOS 8中使用UIAlertController
- Python类方法、静态方法、全局变量的使用
- 证明利用快慢指针寻找有环单链表中环的起点算法
- 关于GC的一写东西
- Oracle 函数大全
- base64
- 求最小公倍数