money = 1000
apple_price = 200
apple_count = input('何個買いますか?')
count = int(apple_count)
total_price = count * apple_price
Balance = money - total_price
if money > total_price:
print('りんごは' + str(count) + '個買いました' )
print('残機は'+ str(Balance)+ '円です')
elif money == total_price:
print('りんごは' + str(count) + '個買いました')
print('残金は0円です')
else:
print('お金が足りませんでした')
回答3件
あなたの回答
tips
プレビュー