当我执行以下代码时,Pycharm中的输出显示不正确。pycharm中的tab字符间距与其他在线python解释器或jupyter笔记本中的tab字符间距有所不同。
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