exercise010_类的调用

# -*- coding: utf-8 -*- 
# @Time : 13/8/18 下午4:43 
# @Author : debin.lin
# @File : exercise010.py 
# @Software: PyCharm
# @Mail : [email protected] 

# 1:写一个软件测试工程师类,具有的属性和技能,你们自己去定

# class User():
#     def __init__(self,name,hiredate,education):
#         self.name = name
#         self.hiredate = hiredate
#         self.education = education
#
#     def test_case(self):
#         print(self.name + "会写测试用例")
#
#     def automated_test(self):
#         print(self.name + "会使用自动化测试工具")
#
# p1 = User('张三', 6, '本科')
# print(p1.name + ','+ '入职' + str(p1.hiredate) + '年,' + p1.education + '学历。')
# p1.test_case()
# p1.automated_test()
# p2 = User('李四', 1, '大专')
# print(p2.name + ','+ '入职' + str(p2.hiredate) + '年,' + p2.education + '学历。' )
# p2.test_case()

class software_enginners():
    def __init__(self,experience,base_ability):
        self.experience=experience
        self.base_ability=base_ability
    def more_abilities(self,more_ability):
        print('你的更多技能是:',more_ability)
years=int(input('几年工作经验:'))
base=input('基本能力:')
software_enginner=software_enginners(years,base)
print('你工作了%d年'%software_enginner.experience)
print('你的基本能力是:'+software_enginner.base_ability)
more=input('你更多的能力有:')
software_enginner.more_abilities(more)
几年工作经验:5
基本能力:自动化
你工作了5年
你的基本能力是:自动化
你更多的能力有:appium环境搭建
你的更多技能是: appium环境搭建

猜你喜欢

转载自blog.csdn.net/weixin_42652708/article/details/81634009