#!/usr/bin/python 3.7.2
# -*- coding: UTF-8 -*-
# Windows 8.1
中文版
x64
from
math
import
pow
from
random
import
uniform
modal
=
input
(
'''
请输入计算模式:
A:
平均模式,用年化收益率平均到月计算复利,如年化
8%,
则第一个月的收益率不到
8%
,使最终的
年化收益率约为
8%
。
准确的年化利率并不是按自然年计算,而是投资满一年的收益率。这里只是预估,所以没有考虑得
很复杂。
R:
随机模式,以随机数的形式模拟年化收益率的浮动,使指定年化收益率在
±5%
范围内随机浮动
'''
)
while
len
(
modal
)
>
0
:
if
str
.
upper
(
modal
) ==
'A'
:
(
'
开始以
A
模式进行计算
……'
)