Python - 继承按如下方式分配 [英] Python - An inheritance is apportioned as follows

查看:91
本文介绍了Python - 继承按如下方式分配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据以下说明将总遗产(1587654美元)划分给父母,子女和亲属。管理员,父母,子女和亲属的继承是什么?



说明:



1。首先,管理员获得继承的百分之一到百分之一加上剩余的东西(没有人收到一小部分美元,只需要全部美元)。

2.每个非子女,非父母亲都得到一部分

3.每个孩子获得100倍于每个亲戚的金额

4.每个孩子的得分是每个孩子的两倍

< br $>
代码:



I'm trying to divide the total inheritance ($1587654) into the parents, children and relatives according to the instruction below. What are the inheritance for the administrator, parents, children and relatives?

Instruction:

1. Firstly, the administrator gets a quarter of one percent of the inheritance plus whatever is left over (nobody receives fractions of dollars, just whole dollars).
2. Each non-child, non-parent relative gets one portion
3. Each child get 100 times the amount of each relative
4. Each parent get twice as much as each child

Code:

import random

total_inheritance = 1587654
administrator_percent = 0.025
parents = 2
children = 3
relatives = 10

推荐答案

1587654)进入根据以下说明,父母,子女和亲属。管理员,父母,子女和亲属的继承是什么?



说明:



1。首先,管理员获得继承的百分之一到百分之一加上剩余的东西(没有人收到一小部分美元,只需要全部美元)。

2.每个非子女,非父母亲都得到一部分

3.每个孩子获得100倍于每个亲戚的金额

4.每个孩子的得分是每个孩子的两倍

< br $>
代码:



1587654) into the parents, children and relatives according to the instruction below. What are the inheritance for the administrator, parents, children and relatives?

Instruction:

1. Firstly, the administrator gets a quarter of one percent of the inheritance plus whatever is left over (nobody receives fractions of dollars, just whole dollars).
2. Each non-child, non-parent relative gets one portion
3. Each child get 100 times the amount of each relative
4. Each parent get twice as much as each child

Code:

import random

total_inheritance = 1587654
administrator_percent = 0.025
parents = 2
children = 3
relatives = 10


这篇关于Python - 继承按如下方式分配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆