Page 1 of 1

Function Name: fixGiftCard() Parameters: promoCode (str) Returns: fixed PromoCode (str) Description: You've won a Amazon

Posted: Mon Jun 06, 2022 1:49 pm
by answerhappygod
Function Name Fixgiftcard Parameters Promocode Str Returns Fixed Promocode Str Description You Ve Won A Amazon 1
Function Name Fixgiftcard Parameters Promocode Str Returns Fixed Promocode Str Description You Ve Won A Amazon 1 (55.24 KiB) Viewed 40 times
pls solve it as Python
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'