python定义一个圆_【两道Python的题关于类的2定义类Circle,要求具有以下方法,编写测试程序进行功能演示(文本方式即可)Circle(point,r):根据给定的圆心和半径生成一个圆,圆...

两道Python的题 关于类的 2 定义类Circle,要求具有以下方法,编写测试程序进行功能演示(文本方式即可)

Circle(point,r):根据给定的圆心和半径生成一个圆,圆心的实现也请定义一个类

moveto(point):将圆心移到新的位置

change_r(x):将半径重新设置为x

get_area():获取面积

3 Create and test a Set class torepresent a classical set. Your sets should support the following methods:

Set(elements)Create a set (elements is the initial list of items in the set).

addElement(x)Adds x to the set.

deleteElement(x)Removes x from the set.

member(x) Returns trueif x is in the set.

intersection(set2)Returns a new set containing just those elements that are common to thisset and set2.

union(set2) Returns a newset containing all of elements that are in this set, set2, or both.

subtract(set2)Returns a new set containing all the elements of this set that are not inset2.

注意:有些方法有返回值,有些没有

表示看不懂……不会写

英语作业帮用户2017-11-03举报

icon_report_d51b383.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值