Python
2015-09-03 09:36
633 查看
1。import math ,无分号结尾,
函数定义:
x= 1
def change():
x= 10;
print x;
print x
显示1;
x= 1
def change():
globle x ;
x= 10;
print x;
print x
显示10;
对象定义
class MyClass:
def __ini__(self):
self.name = "orange"
def setName(name):
self.name = name
x = MyClass
print x.name
函数定义:
x= 1
def change():
x= 10;
print x;
print x
显示1;
x= 1
def change():
globle x ;
x= 10;
print x;
print x
显示10;
对象定义
class MyClass:
def __ini__(self):
self.name = "orange"
def setName(name):
self.name = name
x = MyClass
print x.name
相关文章推荐
- #用Python直接写UTF-8文本文件
- Python开发环境搭建
- Python中的元类(metaclass)
- python 字符串转换,mysql插入带引号字符串,获取html纯文字
- Python资料合集
- Python-BlogServer博客-Django博客效果
- Python--Cmd窗口运行Python时提示Fatal Python error: Py_Initialize: can't initialize sys standard streams LookupError: unknown encoding: cp65001
- Python线程的两种创建方法
- python 学习备忘9.2
- Python的Threading模块的Thread对象的join方法
- Python视频教程
- Building Python 2.7.10 with Visual Studio 2010 or 2015 - Google Chrome
- python webdriver API
- "Python"学习笔记(一)
- python 实现定时循环触发某个方法
- 当Python和R遇上北京二手房(上)
- python初学 汉诺塔攻略实现
- 在ArcGIS中创建Python工具(二)
- Python核心编程-练习
- Python游戏服务器开发日记(六) 解决GIL难题!——Python再认识