Function Name: fixGiftCard() Parameters: promoCode (str) Returns: fixed PromoCode (str) Description: You've won a Amazon
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Function Name: fixGiftCard() Parameters: promoCode (str) Returns: fixed PromoCode (str) Description: You've won a Amazon
Function Name: fixGiftCard() Parameters: promoCode (str) Returns: fixed PromoCode (str) Description: You've won a Amazon gift card for your next order!! Unfortunately, Amazon messed up the promotion codes for your order. Each lowercase letter in the ticket number is meant to be uppercase, and each uppercase letter is meant to be lowercase. Write a function that takes in the promotion code (a string of letters and numbers) and returns a string with the corrected code; that is, with each lowercase letter now uppercase, and each uppercase letter now lowercase. Note: The .isupper() and .islower() methods might be helpful here. >>> fixGiftCard ("tC2Rhf5Y7b") 'Tc2rHF5y7B' >>> fixGiftCard("r88YuHHn4V") 'R88yUhhN4v'