Complete the program to output "accepted" if the card is Visa or Amex. Don't output anything otherwise. | Sololearn: Learn to code for FREE!

0

Complete the program to output "accepted" if the card is Visa or Amex. Don't output anything otherwise.

"accepted" if type = Visa or Amex ( Test case that's wrong Mastercard should output nothing

12/4/2021 1:44:48 AM

Amr Monsef

11 Answers

New Answer

+3

Even if type=='Amex' is False, 'Visa' will always be True What you wanted to do is if type == 'Amex' or type == 'Visa' Or better if type in ['Amex', 'Visa']

+3

Complete the "program"? What "program"?

+3

Amr Monsef Condition is little wrong. There should be if type == 'Amex' or type == 'Visa':

+2

Amr Monsef Show your code? We have to print accepted in case of only Visa or Amex otherwise don't print anything.

+2

Jay Matthews Lol sir there is unknown person who disliked our answer unnecessary even we are right. Can you please check and warn.

+1

Amr Monsef This is just a simple comparison. Test cases are not wrong. You didn't understand this line so you think test cases are wrong. "Complete the program to output "accepted" if the card is Visa or Amex. Don't output anything otherwise." Read last statement again "Don't output anything otherwise".

+1

A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟ Just another one of the millions of trolls and bad apples on SoloDownVote. They can't code so they have to bring themselves up by bringing other people down. P.S. Thank you DV'er for proving my point!

0

it's a task that i can't answer

0

A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟ test case that I GOT WRONG bro I don't know how to solve this and i need help, didn't say the app is wrong lol

0

A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟ type = input () if type == 'Amex' or 'Visa' : print ('accepted') that's all i got here .. but the case im missing is when the input is anything else for instance "Mastercard" it still gets "accepted"

0

thanks Angelo