用Python 3.x编写输出会计分录

用Python 3.x编写输出会计分录

问题描述:

请编写程序输入一下会计分录
借:销售费用-工资 30000.0
贷:应付职工薪酬-工资 30000.0

这样吗:

x=float(input())
print('销售费用-工资 '+str(x))
print('贷:应付职工薪酬-工资 '+str(x))

img

这样写:
n=30000.0
print(f'借:销售费用-工资 {n}')
print(f'\t贷:应付职工薪酬-工资 {n}')

print('借:销售费用-工资 30000.0''\n'' 贷:应付职工薪酬-工资 30000.0')
这个是对的


Amount = int(input('请输入费用:'))
print(f'销售费用-工资{Amount}')
print(f'贷:应付职工薪酬-工资{Amount}')