I have this code here the problem I'm facing is that whenever I put in an input like 35 paperbacks and 15 hardbacks it returns the same number for all 4 months.
# Month 1
# Paperbacks: 35
# Hardbacks: 15
# Month 2
# Paperbacks: 35
# Hardbacks: 15
# Month 3
# Paperbacks: 35
# Hardbacks: 15
# Month 4
# Paperbacks: 35
# Hardbacks: 15
I need it to make it so the paperbacks increase by 100 every month and the hardbacks to increase by 25 every month. So, if I were to input 35 paperbacks and 15 hardbacks, it would return:
Month 1: 135 paperbacks and 40 hardbooks
Im aware that you are supposed to use the +=
operator, but I'm not sure how to use it and implement it into this code.
paperbacks = input('What is the current number of paperbacks? ')
hardbacks = input('What is the current number of hardbacks? ')
# Display the inventory stock table.
for month in range(1, 5):
print(f'Month {month}')
print(f'\tPaperbacks: {paperbacks}')
print(f'\t Hardbacks: {hardbacks}')