2.Selenium2 自动化测试实战-基于Python语言-类和方法

Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 15:51:26) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> class A(object):
	def add(self,a,b):
		return a+b

	
>>> count = A()
>>> print (count.add(5,5))
10
>>> class A():
	def __init__(self,a,b):
		self.a =int(a)
		self.b =int(b)
	def add(self):
		return self.a+self.b

	
>>> count =A('4',5)
>>> print(count.add())
9
>>> 

你可能感兴趣的:(2.Selenium2 自动化测试实战-基于Python语言-类和方法)