以下是为您提供的三个问题的 Python 代码解决方案: 问题一: ```python amount = float(input("请输入购买金额: ")) if amount > 10000: discount = amount * 0.8 elif 5000 <= amount <= 10000: discount = amount * 0.85 elif 3000 <= amount < 5000: discount = amount * 0.9 else: discount = amount print("折扣后的金额为:", discount) ``` 问题二: ```python numbers = [1, 3, 5, 7, 9] total = 0 for num in numbers: total += num print("总和为:", total) ``` 问题三: ```python numbers = [1, 2, 3, 4, 5] square_numbers = [num 2 for num in numbers] print(square_numbers) ``` [2024-10-28 14:46:54 | AI写代码神器 | 235点数解答]