当我执行以下代码时,输出在Pycharm中显示不正确。 pycharm中的制表符间距与其他在线python解释器或jupyter笔记本相比有所不同。
organisms = int(input('Starting number of organisms: '))
increase = float(input('Average daily increase in percent (eg: 5 or 6): '))
days_to_multiply = int(input('Number of days for organisms to multiply: '))
print('Day Approximate\t Population')
for day in range(1,days_to_multiply + 1):
print(day,'\t\t',organisms)
organisms = organisms + organisms * (increase/100)
输出天数和人口未分别在“天数近似”和“人口”行下对齐。
Pycharm的输出:
jupyter和在线python解释器的输出-https://www.onlinegdb.com/online_python_interpreter
人口输出在“人口”下对齐