Untitled
unknown
plain_text
2 years ago
1.6 kB
7
Indexable
def yearly_membership_subscription():
total_cost = 150
monthly_payment = 15
subscription_months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October']
for month in subscription_months:
user_input = input(f"Please enter the payment for {month}: ")
if float(user_input) == monthly_payment:
total_cost -= monthly_payment
else:
print("Invalid payment amount. Please try again.")
if total_cost <= 0:
deliver_christmas_tree()
else:
print("Sorry, your payment is incomplete. Please try again.")
def deliver_christmas_tree():
rebate_percentage = 0.5
rebate_amount = 0.5 * 150
user_input = input("Please confirm that you want to receive the living potted Christmas tree (yes/no): ")
if user_input.lower() == 'yes':
print(f"You will receive the living potted Christmas tree. Return it after use for a {rebate_percentage * 100}% rebate of ${rebate_amount} and plant it for carbon offsets.")
elif user_input.lower() == 'no':
print("Okay, you have chosen not to receive the living potted Christmas tree.")
else:
print("Invalid input. Please try again.")
# Main program
def main():
user_input = input("Welcome! Are you interested in subscribing to a yearly membership? (yes/no): ")
if user_input.lower() == 'yes':
yearly_membership_subscription()
elif user_input.lower() == 'no':
print("Okay, thank you for visiting!")
else:
print("Invalid input. Please try again.")
if __name__ == "__main__":
main()Editor is loading...
Leave a Comment