Skip to content

Sentimental/Credit does not check if Luhns algorithm is implemented #86

@mcchots

Description

@mcchots

This code passes all checks in check50 and scores 100% with submit50

from cs50 import get_string

number = get_string("Number: ")

if len(number) == 15 and number[0] == "3":
    print("AMEX")
elif len(number) == 16 and number[0] == "4":
    print("VISA")
elif len(number) == 16 and number[0] == "5":
    print("MASTERCARD")
else:
    print("INVALID")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions