我的计划不计算你有多少欧元票,我想要的

时间:2017-09-16 05:12:32

标签: python python-3.x pycharm

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<table border=1 ng-app>
  <tr>
    <th>Products</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>Product 1</td>
    <td ng-model="one">120</td>
  </tr>
  <tr>
    <td>Product 2</td>
    <td ng-model="two">120</td>
  </tr>
  <tr>
    <td>Product 3</td>
    <td ng-model="three">120</td>
  </tr>
</table>
{{ one + two + three }}
<div>         
     

      
     

对于我的分解计划,一些欧元的硬币。执行时执行条件,如果另一个也执行我。 当它经历倒数第二个周期时,它也评估我并显示另一个。我能做什么

1 个答案:

答案 0 :(得分:0)

由于语法错误导致我无法将您的代码转换为工作版本,所以我自己编写了

num = int(input("Please enter an amount in euros: "))

banknotes = {
    500: "500 euro banknote (s)",
    200: "ticket (s) of 200 euros",
    100: "ticket (s) of 100 euros",
    50: "50 euro banknote (s)",
    20: "ticket (s) of 20 euros",
    10: "ticket (s) of 10 euros",
    5: "ticket (s) of 5 euros",
    2: "currency (s) of 2 euros",
    1: "currency (s) of 1 euros"
}

while num:
    max_banknote = max(list(filter(lambda y: y <= num, banknotes)))

    count = num // max_banknote
    num -= count*max_banknote
    print("There", count, banknotes[max_banknote])