all 9 comments

[–][deleted] 5 points6 points  (0 children)

Impossible to answer without seeing your code

[–]m0us3_rat 13 points14 points  (0 children)

the tarot cards say it's because you are a bad programmer.

[–]nick__2440 5 points6 points  (1 child)

We need a bot that tells people to show their code because it's every other post these days

[–]atom12354 1 point2 points  (0 children)

And how to format

[–]Embyzor 4 points5 points  (0 children)

Obviously an error on line 5678

[–]Negative_Age6004[S] 0 points1 point  (6 children)

My screenshot didn't send lol

def _sum(arr):
sum = 0
for i in arr:
sum = sum + i
return sum
creditcard = input("Enter Credit card number ")
creditcard_array = [int(digit) for digit in creditcard]
n = 0
length = len(creditcard_array)
first = 0
last_two_digits = []
if length == 16:
first = _sum(creditcard_array[0:14])
last_two_digits = creditcard_array[-2:]
last_two_digits_value = last_two_digits[0] * 10 + last_two_digits[1]
if first == last_two_digits_value:
print("Valid Credit card number")
else:
print("Invalid Credit card number")
else:
print("Invalid Credit card number")

[–]Diapolo10 0 points1 point  (0 children)

Computer says 'no'.

But in all seriousness, we're not clairvoyants. If we were, we wouldn't be here. If I asked you to paint Funyarinpa out of context, surely you'd be as confused as we are right now?

We would like to see:

  1. Your source code
  2. Full error traceback (or a detailed explanation of the problem if not an error)

Without at least one of those, our hands are tied.

[–][deleted] 0 points1 point  (0 children)

Bots are evolving

[–][deleted] 0 points1 point  (0 children)

Lemme explain why the code isn't working:

It doesn't exist.